123
This commit is contained in:
210
Editor/XT/Include/CJLibrary.h
Normal file
210
Editor/XT/Include/CJLibrary.h
Normal file
@@ -0,0 +1,210 @@
|
||||
//:Ignore
|
||||
// CJLibrary.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__CJLIBRARY_H__)
|
||||
#define __CJLIBRARY_H__
|
||||
|
||||
//:Ignore
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
//:End Ignore
|
||||
|
||||
|
||||
#include <XTToolkit.h>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// PROGRAMMERS NOTE:
|
||||
// This file is intended to offer support for users who have upgraded from using
|
||||
// CJLibrary, it is not intended for use on new projects, and only as a temporary
|
||||
// solution.
|
||||
|
||||
#define CCJBrowseButton CXTBrowseButton
|
||||
#define CCJBrowseEdit CXTBrowseEdit
|
||||
#define CCJCaption CXTCaption
|
||||
#define CCJCaptionButton CXTCaptionButton
|
||||
#define CCJCaptionPopupWnd CXTCaptionPopupWnd
|
||||
#define CCJCBarButton // obsolete in XTreme toolkit
|
||||
#define CCJColorPicker CXTColorPicker
|
||||
#define CCJColorPopup CXTColorPopup
|
||||
#define CCJComboBoxEx CXTComboBoxEx
|
||||
#define CCJControlBar CXTDockWindow
|
||||
#define CCJDateEdit CXTDateEdit
|
||||
#define CCJDateTimeCtrl CXTDateTimeCtrl
|
||||
#define CCJDockBar CXTDockBar
|
||||
#define CCJDockContext CXTDockContext
|
||||
#define CCJExplorerBar // obsolete in XTreme toolkit
|
||||
#define CCJFlatButton CXTButton
|
||||
#define CCJFlatComboBox CXTFlatComboBox
|
||||
#define CCJFlatHeaderCtrl CXTFlatHeaderCtrl
|
||||
#define CCJFlatSplitterWnd CXTSplitterWnd
|
||||
#define CCJFlatTabCtrl CXTFlatTabCtrl
|
||||
#define CCJFontCombo CXTFontCombo
|
||||
#define CCJFrameWnd CXTFrameWnd
|
||||
#define CCJHexEdit CXTHexEdit
|
||||
#define CCJHtmlView CXTHtmlView
|
||||
#define CCJHyperLink CXTHyperLink
|
||||
#define CCJListBox CXTListBox
|
||||
#define CCJListCtrl CXTListCtrl
|
||||
#define CCJListView CXTListView
|
||||
#define CCJLogoPane CXTLogoPane
|
||||
#define CCJMaskEdit CXTMaskEdit
|
||||
#define CCJMDIChildWnd CXTMDIChildWnd
|
||||
#define CCJMDIFrameWnd CXTMDIFrameWnd
|
||||
#define CCJMemFile CXTMemFile
|
||||
#define CCJMenu // obsolete in XTreme toolkit
|
||||
#define CCJMenuBar CXTMenuBar
|
||||
#define CCJMenuBarFrameHook CXTMBarWndHook
|
||||
#define CCJMenuData // obsolete in XTreme toolkit
|
||||
#define CCJMetaFileButton // obsolete in XTreme toolkit
|
||||
#define CCJMiniDockFrameWnd CXTMiniDockFrameWnd
|
||||
#define CCJMonthCalCtrl CXTMonthCalCtrl
|
||||
#define CCJOutlookBar CXTOutlookBar
|
||||
#define CCJPagerCtrl CXTPagerCtrl
|
||||
#define CCJReBar CXTReBar
|
||||
#define CCJReBarCtrl CXTReBarCtrl
|
||||
#define CCJShell // obsolete in XTreme toolkit
|
||||
#define CCJShellList CXTShellListCtrl
|
||||
#define CCJShellTree CXTShellTreeCtrl
|
||||
#define CCJSizeDockBar CXTDockBar
|
||||
#define CCJSortClass CXTSortClass
|
||||
#define CCJStatusBar CXTStatusBar
|
||||
#define CCJStatusBarPane // obsolete in XTreme toolkit
|
||||
#define CCJStatusBarPaneControlInfo // obsolete in XTreme toolkit
|
||||
#define CCJTabCtrl CXTTabCtrl
|
||||
#define CCJTabCtrlBar CXTTabCtrlBar
|
||||
#define CCJTabView CXTTabView
|
||||
#define CCJTimeEdit CXTTimeEdit
|
||||
#define CCJToolBar CXTToolBar
|
||||
#define CCJToolBarBase CXTControlBar
|
||||
#define CCJToolBarCtrl CXTToolBarCtrl
|
||||
#define CCJTreeCtrl CXTTreeCtrl
|
||||
#define CCJWindowPlacement CXTWindowPos
|
||||
#define CContentItems CXTContentItems
|
||||
#define CGfxGroupEdit CXTEditItem
|
||||
#define CMenuItemInfo // obsolete in XTreme toolkit
|
||||
#define ColorTableEntry XT_PICK_BUTTON
|
||||
#define CSubclassWnd CXTWndHook
|
||||
#define CSubclassWndMap CXTWindowMap
|
||||
#define DROPDOWNBUTTON CXTDropDownButton
|
||||
#define AFX_OLDTOOLINFO XT_OLDTOOLINFO
|
||||
#define CTV_ITEM XT_TCB_ITEM
|
||||
#define LVITEMDATA XT_LVITEMDATA
|
||||
#define LPLVITEMDATA XT_LPLVITEMDATA
|
||||
#define TCB_ITEM XT_TCB_ITEM
|
||||
#define TVITEMDATA XT_TVITEMDATA
|
||||
#define LPTVITEMDATA XT_LPTVITEMDATA
|
||||
#define TOOLBARINFO // obsolete in XTreme toolkit
|
||||
#define CJX_COLORMAP XT_COLORMAP
|
||||
#define AFX_DLLVERSIONINFO XT_DLLVERSIONINFO
|
||||
#define CJX_CONTROLPOS XT_CONTROLPOS
|
||||
#define CToolBarData XT_TOOLBARDATA
|
||||
#define CGfxSplitterWnd CXTSplitterWndEx
|
||||
|
||||
class CGfxOutBarCtrl : public CXTOutBarCtrl
|
||||
{
|
||||
public:
|
||||
enum { fSmallIcon = OBS_XT_SMALLICON,
|
||||
fLargeIcon = OBS_XT_LARGEICON,
|
||||
fEditGroups = OBS_XT_EDITGROUPS,
|
||||
fEditItems = OBS_XT_EDITITEMS,
|
||||
fRemoveGroups = OBS_XT_REMOVEGROUPS,
|
||||
fRemoveItems = OBS_XT_REMOVEITEMS,
|
||||
fAddGroups = OBS_XT_ADDGROUPS,
|
||||
fDragItems = OBS_XT_DRAGITEMS,
|
||||
fAnimation = OBS_XT_ANIMATION,
|
||||
fSelHighlight = OBS_XT_SELHIGHLIGHT };
|
||||
|
||||
enum { ircIcon = 1 // RC_OB_ICON,
|
||||
ircLabel = 2 // RC_OB_LABEL,
|
||||
ircAll = 3 // RC_OB_BOTH };
|
||||
};
|
||||
|
||||
struct OUTBAR_INFO : public XT_OUTBAR_INFO
|
||||
{
|
||||
OUTBAR_INFO() : index(nIndex), iDragFrom(nDragFrom), iDragTo(nDragTo), cText(lpszText) {}
|
||||
int& index;
|
||||
int& iDragFrom;
|
||||
int& iDragTo;
|
||||
LPCTSTR& cText;
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
NONE = 0,
|
||||
OUTLINE = CBRS_XT_CLIENT_OUTLINE,
|
||||
SUNKEN = CBRS_XT_CLIENT_STATIC,
|
||||
RAISED = CBRS_XT_CLIENT_MODAL
|
||||
}
|
||||
CHILD_BORDER;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Global functions:
|
||||
|
||||
#define _LoadSysColorBitmap(hInst, hRsrc, bMono) _xtAfxLoadSysColorBitmap(hInst, hRsrc, bMono)
|
||||
#define DDX_CJMonthCalCtrl(pDX, nIDC, value) DDX_XTMonthCalCtrl(pDX, nIDC, value)
|
||||
#define DDX_CJColorPicker(pDX, nIDC, value) DDX_XTColorPicker(pDX, nIDC, value)
|
||||
#define DDX_CJDateTimeCtrl(pDX, nIDC, value) DDX_XTDateTimeCtrl(pDX, nIDC, value)
|
||||
#define DDX_OleDateTime(pDX, nIDC, rControl, rDateTime) DDX_XTOleDateTime(pDX, nIDC, rControl, rDateTime)
|
||||
#define DDV_CJMinMaxDateTime(pDX, refValue, pMinRange, pMaxRange) DDV_XTMinMaxDateTime(pDX, refValue, pMinRange, pMaxRange)
|
||||
#define DDV_CJMinMaxMonth(pDX, refValue, pMinRange, pMaxRange) DDV_XTMinMaxMonth(pDX, refValue, pMinRange, pMaxRange)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Definitions:
|
||||
|
||||
#define _ComCtlVersion _xtAfxComCtlVersion
|
||||
#define _GetComCtlVersion() _xtAfxGetComCtlVersion()
|
||||
#define _dropDownWidth // obsolete in XTreme toolkit
|
||||
#define _GetDropDownWidth() // obsolete in XTreme toolkit
|
||||
#define AFX_IDW_SIZEBAR_LEFT AFX_IDW_DOCKBAR_LEFT
|
||||
#define AFX_IDW_SIZEBAR_RIGHT AFX_IDW_DOCKBAR_RIGHT
|
||||
#define AFX_IDW_SIZEBAR_TOP AFX_IDW_DOCKBAR_TOP
|
||||
#define AFX_IDW_SIZEBAR_BOTTOM AFX_IDW_DOCKBAR_BOTTOM
|
||||
#define CM_ONPUSHPINBUTTON CPWN_XT_PUSHPINBUTTON
|
||||
#define CM_ONPUSHPINCANCEL CPWN_XT_PUSHPINCANCEL
|
||||
#define WS_EX_FLATEDGE // obsolete in XTreme toolkit
|
||||
#define CPN_SELCHANGE CPN_XT_SELCHANGE
|
||||
#define CPN_DROPDOWN CPN_XT_DROPDOWN
|
||||
#define CPN_CLOSEUP CPN_XT_CLOSEUP
|
||||
#define CPN_SELENDOK CPN_XT_SELENDOK
|
||||
#define CPN_SELENDCANCEL CPN_XT_SELENDCANCEL
|
||||
#define FTS_BOTTOM FTS_XT_BOTTOM
|
||||
#define FTS_HASARROWS FTS_XT_HASARROWS
|
||||
#define FTS_HASHOMEEND FTS_XT_HASHOMEEND
|
||||
#define _CJX_EXT_CLASS _XT_EXT_CLASS
|
||||
#define _CJXLIB_INLINE inline
|
||||
#define WM_SHELL_NOTIFY XTWM_SHELL_NOTIFY
|
||||
#define NM_SH_SHELLMENU SHN_XT_SHELLMENU
|
||||
#define WM_OUTBAR_NOTIFY XTWM_OUTBAR_NOTIFY
|
||||
#define NM_OB_ITEMCLICK OBN_XT_ITEMCLICK
|
||||
#define NM_OB_ONLABELENDEDIT OBN_XT_ONLABELENDEDIT
|
||||
#define NM_OB_ONGROUPENDEDIT OBN_XT_ONGROUPENDEDIT
|
||||
#define NM_OB_DRAGITEM OBN_XT_DRAGITEM
|
||||
#define NM_FOLDERCHANGE OBN_XT_FOLDERCHANGE
|
||||
#define NM_OB_ITEMHOVER OBN_XT_ITEMHOVER
|
||||
#define BT_POPUPMENU BES_XT_POPUPMENU
|
||||
#define BT_DIRECTORY BES_XT_CHOOSEDIR
|
||||
#define BT_FILE BES_XT_CHOOSEFILE
|
||||
#define BROWSE_TYPE DWORD
|
||||
#define CP_MODE_TEXT // obsolete in XTreme toolkit
|
||||
#define CP_MODE_BK // obsolete in XTreme toolkit
|
||||
#define BTN_IMG_INDEX // obsolete in XTreme toolkit
|
||||
#define CTabList // obsolete in XTreme toolkit
|
||||
#define CMDIMenuList // obsolete in XTreme toolkit
|
||||
#define DATA_TYPE XT_DATA_TYPE
|
||||
#define CTabViews // obsolete in XTreme toolkit
|
||||
#define CListViews // obsolete in XTreme toolkit
|
||||
|
||||
#endif // #if !defined(__CJLIBRARY_H__)
|
||||
//:End Ignore
|
||||
103
Editor/XT/Include/XTAccelKeyEdit.h
Normal file
103
Editor/XT/Include/XTAccelKeyEdit.h
Normal file
@@ -0,0 +1,103 @@
|
||||
// XTAccelKeyEdit.h : interface for the CXTAccelKeyEdit class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTACCELKEYEDIT_H__)
|
||||
#define __XTACCELKEYEDIT_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTAccelKeyEdit is derived from CEdit. It is used by the "configure
|
||||
// shortcuts page" to assign accelerator keyboard shortcuts. This class
|
||||
// will manage the customization of keyboard shortcuts and assignment of
|
||||
// commands to those shortcuts.
|
||||
class CXTAccelKeyEdit : public CEdit
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTAccelKeyEdit object.
|
||||
CXTAccelKeyEdit();
|
||||
|
||||
// Summary: Destroys a CXTAccelKeyEdit object, handles cleanup and de-allocation.
|
||||
virtual ~CXTAccelKeyEdit();
|
||||
|
||||
private:
|
||||
|
||||
BOOL m_bShift;
|
||||
BOOL m_bCtrl;
|
||||
BOOL m_bAlt;
|
||||
WORD m_nVirtualKeyCode;
|
||||
BOOL m_bKeyDefined;
|
||||
|
||||
public:
|
||||
|
||||
// Summary: This member function is called to reset the edit control.
|
||||
void Reset();
|
||||
|
||||
// Input: nVirtualKeyCode - Reference to a WORD object that will receive the
|
||||
// virtual key code that represents the virtual keys the user has selected.
|
||||
// bCtrl - Reference to a BOOL object that will be TRUE if the VK_CONTROL key
|
||||
// was pressed, otherwise set to FALSE.
|
||||
// bAlt - Reference to a BOOL object that will be TRUE if the VK_MENU key
|
||||
// was pressed, otherwise set to FALSE.
|
||||
// bShift - Reference to a BOOL object that will be TRUE if the VK_SHIFT key
|
||||
// was pressed, otherwise set to FALSE.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function is called to determine which virtual keys
|
||||
// have been selected.
|
||||
BOOL GetKeyInfo(WORD& nVirtualKeyCode, BOOL& bCtrl, BOOL& bAlt, BOOL& bShift);
|
||||
|
||||
// Returns: TRUE if a virtual key was defined other than VK_SHIFT, VK_CONTROL or VK_MENU,
|
||||
// otherwise returns FALSE.
|
||||
// Summary: This member function checks to see if a virtual key, other than VK_SHIFT,
|
||||
// VK_CONTROL or VK_MENU, was defined.
|
||||
BOOL IsKeyDefined();
|
||||
|
||||
protected:
|
||||
|
||||
// Summary: This member function is called to update the text that is displayed
|
||||
// in the edit field.
|
||||
void UpdateKeyString();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTAccelKeyEdit)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTAccelKeyEdit)
|
||||
afx_msg void OnKillFocus(CWnd* pNewWnd);
|
||||
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE BOOL CXTAccelKeyEdit::IsKeyDefined() {
|
||||
return m_bKeyDefined;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(__XTACCELKEYEDIT_H__)
|
||||
309
Editor/XT/Include/XTAccelManager.h
Normal file
309
Editor/XT/Include/XTAccelManager.h
Normal file
@@ -0,0 +1,309 @@
|
||||
// XTAccelManager.h : interface for the CXTAccelManager class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTACCELMANAGER_H_)
|
||||
#define __XTACCELMANAGER_H_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
// Summary: CMap definition for mapping accelerator categories.
|
||||
typedef CMap<UINT, UINT, CString, LPCTSTR> CXTMapAccelCategory;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTAccelSwapOutItemList is a CMap derived class. This class is used
|
||||
// to hold a list of swap-out commands.
|
||||
class _XT_EXT_CLASS CXTAccelSwapOutItemList : public CXTMapAccelCategory {};
|
||||
|
||||
// Summary: XT_EXTRA_ACCELITEM is a stand alone structure class. It is used to
|
||||
// create a structure that represents an accelerator item.
|
||||
struct XT_EXTRA_ACCELITEM
|
||||
{
|
||||
UINT nCommandID; // The command ID that this item represents.
|
||||
CString szCategory; // The category, or top level menu name, that this command belongs to.
|
||||
CString szName; // The name, or menu item text, that this item represents.
|
||||
};
|
||||
|
||||
// Summary: XT_VKEYMAP is a stand alone structure class. It is used to define a
|
||||
// structure used to map virtual key codes to their human readable names.
|
||||
struct XT_VKEYMAP
|
||||
{
|
||||
WORD wKey; // Virtual Key Code.
|
||||
LPCTSTR szKeyName; // Display Name (i.e "CTRL").
|
||||
};
|
||||
|
||||
// Summary: XT_CATEGORY is a stand alone structure class. It is used by the
|
||||
// accelerator manager to map a category title with an associated HMENU
|
||||
// handle.
|
||||
struct XT_CATEGORY
|
||||
{
|
||||
HMENU hSubMenu; // Handle to the menu associated with the category.
|
||||
CString strCategory; // Title of the menu category.
|
||||
};
|
||||
|
||||
// Summary: CList definition for the category structure array.
|
||||
typedef CList<XT_CATEGORY,XT_CATEGORY&> CXTCategoryList;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTMapString is a CObject derived helper class. It is used to map IDs
|
||||
// to command strings.
|
||||
class CXTMapString : public CObject
|
||||
{
|
||||
public:
|
||||
|
||||
UINT m_nID; // ID of the command to map.
|
||||
CString m_szName; // A NULL terminated string.
|
||||
|
||||
// Input: item - A reference to a valid CXTMapString object.
|
||||
// Returns: A reference to a valid CXTMapString object.
|
||||
// Summary: Use this assignment operator to initialize a CXTMapString object.
|
||||
const CXTMapString& operator=(const CXTMapString& item);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE const CXTMapString& CXTMapString::operator=(const CXTMapString& item) {
|
||||
m_nID = item.m_nID; m_szName = item.m_szName; return *this;
|
||||
}
|
||||
|
||||
// Summary: CList definition for the map string object array.
|
||||
typedef CList<CXTMapString, CXTMapString&> CXTMapStringList;
|
||||
|
||||
// Summary: CList definition for the extra accelitem struct array.
|
||||
typedef CList<XT_EXTRA_ACCELITEM*, XT_EXTRA_ACCELITEM*> CXTExtraItems;
|
||||
|
||||
// Summary: CMap definition for mapping command exclude lists.
|
||||
typedef CMap<UINT, UINT, UINT, UINT> CXTMapCommandExcludeList;
|
||||
|
||||
// Summary: CMap definition for mapping accelerator accelerator swapo ut item lists.
|
||||
typedef CMap<UINT, UINT, CXTAccelSwapOutItemList*, CXTAccelSwapOutItemList*&> CXTSwapOutList;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTAccelManager is a stand alone class. It encapsulates the configurable
|
||||
// keyboard accelerator functions.
|
||||
class _XT_EXT_CLASS CXTAccelManager
|
||||
{
|
||||
private:
|
||||
|
||||
// Summary: Constructs a CXTAccelManager object.
|
||||
CXTAccelManager();
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Destroys a CXTAccelManager object, handles cleanup and de-allocation.
|
||||
virtual ~CXTAccelManager();
|
||||
|
||||
protected:
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Frame window binding information
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CFrameWnd* m_pFrameWnd; // A CFrameWnd pointer to the frame window that the accelerators are connected to.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// String list of command categories (top level menu items).
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CXTCategoryList m_comboCategoryList; // A list used to map command IDs to display strings.
|
||||
CXTMapStringList m_mapAccelString; // A list of command IDs to display categories.
|
||||
CXTMapAccelCategory m_mapAccelCategory; // A map of command IDs to exclude from the string list.
|
||||
CXTMapCommandExcludeList m_MapCommandExcludeList; // A map of swap-out command IDs.
|
||||
CXTSwapOutList m_SwapOutList; // A map of extra commands for each category.
|
||||
CXTExtraItems m_ExtraItems; // A list of additional commands that have accelerator definitions.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Our accelerator buffer
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
int m_nAccelBufferCount; // The count of accelerators pointed to by 'm_pAccelBuffer'.
|
||||
int m_nAccelDefaultCount; // The count of accelerators pointed to by 'm_pAccelDefault'.
|
||||
bool m_bDefaultInUse; // true if the 'm_pAccelBuffer' currently contains a copy of the default accelerators.
|
||||
bool m_bChanged; // true if the contents of 'm_pAccelBuffer' has been changed.
|
||||
bool m_bAutoSave; // true if the accelerator data is automatically saved when this class is destroyed.
|
||||
bool m_bInitialized; // true if the accelerator data has been initialized for the frame object.
|
||||
LPACCEL m_pAccelBuffer; // The array of accelerators.
|
||||
LPACCEL m_pAccelDefault; // The array of default accelerators.
|
||||
static XT_VKEYMAP m_VirtSysKeys[]; // Virtual System Key ID to Name mappings.
|
||||
static XT_VKEYMAP m_VirtKeys[]; // Virtual Key ID to Name mappings.
|
||||
|
||||
public:
|
||||
|
||||
// Example: <pre>CXTAccelManager::Get().Init( this );</pre>
|
||||
// Returns: A reference to the one and only CXTAccelManager object.
|
||||
// Summary: This static member function will retrieve a reference to the one
|
||||
// and only CXTAccelManager object. You can use this function to access
|
||||
// data members for the CXTAccelManager class.
|
||||
static CXTAccelManager& Get();
|
||||
|
||||
// Returns: true if the accelerator data has been initialized, otherwise it returns false.
|
||||
// Summary: This member function will check to see if the accelerator data has been
|
||||
// initialized.
|
||||
bool IsInitialized();
|
||||
|
||||
// Input: pWnd - A CFrameWnd pointer to the frame window whose keyboard shortcuts
|
||||
// should be managed.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function initializes the accelerator manager and loads default
|
||||
// and user defined accelerator tables.
|
||||
bool Init(CFrameWnd* pWnd);
|
||||
|
||||
// Input: bUnInitialize - true if the object is to be un-initialized.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function saves the current keyboard accelerator.
|
||||
bool Save(bool bUnInitialize=false);
|
||||
|
||||
// Input: bUpdateWindowAccel - true to, when loaded, apply the configuration to
|
||||
// the current frame window.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function loads a new keyboard accelerator.
|
||||
bool Load(bool bUpdateWindowAccel = true);
|
||||
|
||||
// Returns: A valid CMenu pointer if successful, otherwise returns NULL.
|
||||
// Summary: This member function is called to get a pointer to the frame's
|
||||
// active menu.
|
||||
CMenu* GetFrameMenu();
|
||||
|
||||
// Input: bEnable - true to enable autosave.
|
||||
// Summary: Call this member function to enable or disable the autosave feature.
|
||||
// Autosave will automatically save the accelerator information when
|
||||
// this object is destroyed.
|
||||
void EnableAutoSave(bool bEnable);
|
||||
|
||||
// Input: hMenu - NEEDS DESCRIPTION
|
||||
// Summary: This member function is called to initialize the default and user
|
||||
// defined accelerator tables for the manager, and must be called after the
|
||||
// Init(...) method has been called.
|
||||
void InitAccelerators(HMENU hMenu=NULL);
|
||||
|
||||
// Input: nCommand - The command ID to exclude.
|
||||
// Summary: This member function is used to exclude a specific command ID. To exclude
|
||||
// a specific command ID, call this method before calling Init(...).
|
||||
void ExcludeCommandID(UINT nCommand);
|
||||
|
||||
// Input: nSwapOutID - The command ID of the menu item, defined in the menu resource,
|
||||
// that should be replaced.
|
||||
// nCommandID - The command ID to add to the menu.
|
||||
// szName - The menu string to add.
|
||||
// Summary: Call this method to set one or more swapout IDs, in the case where
|
||||
// there is a dynamic menu item. An example of where this can be used would
|
||||
// be the MRU in a standard doc/view application. Add a single command
|
||||
// to the menu resource that can be swapped out with the commands you
|
||||
// set here. Call this method once for each command you want to replace.
|
||||
// For example, if you had a command ID called IDC_MRUPLACEHOLDER, and
|
||||
// you wanted to add four new items in place of this which are IDC_MRUFILE1,
|
||||
// IDC_MRUFILE2, IDC_MRUFILE3, IDC_MRUFILE4 you should do the following: -
|
||||
// <pre>
|
||||
// kbsm.AddSwapoutCommand(IDC_MRUPLACEHOLDER, IDC_MRUFILE1, "File 1");
|
||||
// kbsm.AddSwapoutCommand(IDC_MRUPLACEHOLDER, IDC_MRUFILE2, "File 2");
|
||||
// kbsm.AddSwapoutCommand(IDC_MRUPLACEHOLDER, IDC_MRUFILE3, "File 3");
|
||||
// kbsm.AddSwapoutCommand(IDC_MRUPLACEHOLDER, IDC_MRUFILE4, "File 4");</pre>
|
||||
void AddSwapoutCommand(UINT nSwapOutID, UINT nCommandID, LPCTSTR szName);
|
||||
|
||||
// Input: szCategory - The category that this command should be added under.
|
||||
// nCommandID - The command ID for this extra command.
|
||||
// szName - The menu string for this command.
|
||||
// Summary: This member function adds command IDs that are not found in the menu,
|
||||
// but you want to have appear in the keyboard shortcut configuration and
|
||||
// assignment property pages.
|
||||
void AddExtraCommand(LPCTSTR szCategory, UINT nCommandID, LPCTSTR szName);
|
||||
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function applies the current accelerators to the window.
|
||||
bool UpdateWindowAccelerator();
|
||||
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function is called to restore the default accelerators for
|
||||
// the frame window.
|
||||
bool LoadDefaultAccelerator();
|
||||
|
||||
// Input: nCommand - The command ID.
|
||||
// szKeys - Retrieves the displayable string(s) for the assigned shortcuts
|
||||
// (i.e. "Ctrl+C").
|
||||
// Summary: This member function will, given a command ID, return a string describing
|
||||
// the currently assigned keys, if any.
|
||||
void GetKeyAssignmentStrings(UINT nCommand, CString& szKeys);
|
||||
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Override this member function to handle custom loading of the accelerator
|
||||
// data.
|
||||
virtual bool OnLoad();
|
||||
|
||||
// Input: pTable - Pointer to the accelerator table (array) to save.
|
||||
// nCount - The number of elements in the above array.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Override this member function to handle custom saving of the accelerator
|
||||
// data.
|
||||
virtual bool OnSave(LPACCEL pTable, int nCount);
|
||||
|
||||
// Input: pMsg - A pointer to a valid MSG structure.
|
||||
// Returns: true if the message was handled, otherwise returns false.
|
||||
// Summary: This member function is called by the framework to allow the accelerator
|
||||
// manager to process any messages before they are forwarded.
|
||||
bool TranslateAccelerator(MSG* pMsg);
|
||||
|
||||
private:
|
||||
|
||||
// Helper methods used by the configuration pages
|
||||
|
||||
POSITION GetCommandStringStartPosition();
|
||||
void GetNextCommandStringItem(POSITION& rPos, UINT& nCommandID, CString& szString);
|
||||
bool LookupCommandStringItem(UINT nCommandID, CString& szString);
|
||||
void SetCommandStringItem(UINT nCommandID, CString szName);
|
||||
void GetCategoryList(CComboBox& cb);
|
||||
bool IsCommandInCategory(UINT nCommandID, LPCTSTR szCategory);
|
||||
bool LookupCommandCategory(UINT nCommandID, CString& szCategory);
|
||||
bool GetKeyAssignmentInfo(int& nPos, UINT nCommand, CString& szName, BYTE& cVirt, WORD& wKey);
|
||||
bool AddKeyAssignment(UINT nCommand, BYTE cVirt, WORD wKey);
|
||||
bool GetKeyAssignment(BYTE cVirt, WORD wKey, UINT& nCommand);
|
||||
bool DeleteKeyAssignment(BYTE cVirt, WORD wKey);
|
||||
void MakeDisplayName(CXTString& str);
|
||||
void MakeKeyString(ACCEL Accel, CString& szName);
|
||||
void SaveDefaultAcceleratorTable(CFrameWnd* pFrameWnd);
|
||||
bool AddMenuItemsToNameList(HMENU hMenu, CString szParentName, LPCTSTR szCategory);
|
||||
static LPCTSTR GetVirtualKeyString(WORD wKey);
|
||||
bool MenuHasCommands(HMENU hMenu);
|
||||
void BuildCategoryList(HMENU hMenu, CString strParentItem);
|
||||
CXTMapStringList& GetCommandStringList();
|
||||
|
||||
// These classes need access to edit the keyboard accelerators.
|
||||
|
||||
friend class CXTCustAccelerators;
|
||||
friend class CXTAccelKeyEdit;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTAccelManager::ExcludeCommandID(UINT nCommand) {
|
||||
m_MapCommandExcludeList.SetAt(nCommand, nCommand);
|
||||
}
|
||||
AFX_INLINE POSITION CXTAccelManager::GetCommandStringStartPosition() {
|
||||
return m_mapAccelString.GetHeadPosition();
|
||||
}
|
||||
AFX_INLINE bool CXTAccelManager::IsInitialized() {
|
||||
return m_bInitialized;
|
||||
}
|
||||
AFX_INLINE void CXTAccelManager::EnableAutoSave(bool bEnable) {
|
||||
m_bAutoSave = bEnable;
|
||||
}
|
||||
AFX_INLINE CXTMapStringList& CXTAccelManager::GetCommandStringList() {
|
||||
return m_mapAccelString;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(__XTACCELMANAGER_H_)
|
||||
108
Editor/XT/Include/XTAnimationMemDC.h
Normal file
108
Editor/XT/Include/XTAnimationMemDC.h
Normal file
@@ -0,0 +1,108 @@
|
||||
// XTAnimationMemDC.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(___XTANIMATIONMEMDC_H__)
|
||||
#define ___XTANIMATIONMEMDC_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
// Summary: Enumerated type used to determine animation effect.
|
||||
enum ANIMATIONTYPE
|
||||
{
|
||||
animateWindowsDefault, // As defined in the "Display" settings.
|
||||
animateRandom, // Any of the first three in random selection.
|
||||
animateUnfold, // Unfold top to bottom.
|
||||
animateSlide, // Slide in from left.
|
||||
animateFade, // Fade-in.
|
||||
animateNone // No animation.
|
||||
};
|
||||
|
||||
// Input: rc - Area to display.
|
||||
// pDestDC - Destination device context.
|
||||
// pSrcDC - Source device context.
|
||||
// nType - Enumerated ANIMATIONTYPE to determine animation effect.
|
||||
// nSteps - Number of steps to complete animation.
|
||||
// nAnimationTime - Amount of time in milliseconds between each step.
|
||||
// Summary: Function pointer used to define a custom animation effect.
|
||||
// See Also: CXTAnimationMemDC::SetCustomAnimation, ANIMATIONTYPE
|
||||
typedef void (*xtAnimationProc)(CRect rc, CDC* pDestDC, CDC* pSrcDC, int nType, int nSteps, int nAnimationTime);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTAnimationMemDC is a CXTMemDC derived class. This class is a replacement
|
||||
// for the commonly used XTMemDC. By calling Animate(), the contained
|
||||
// bitmap is drawn on the screen with a given effect. This effect is equal
|
||||
// to the Menu effect in Windows® and Office™.
|
||||
class _XT_EXT_CLASS CXTAnimationMemDC : public CXTMemDC
|
||||
{
|
||||
public:
|
||||
|
||||
// Input: pDC - A pointer to a CDC object.
|
||||
// rect - An address of a CRect object.
|
||||
// clrColor - An RGB value that represents the current system face color of
|
||||
// three dimensional display elements.
|
||||
// Summary: Constructs a CXTAnimationMemDC object.
|
||||
CXTAnimationMemDC(CDC* pDC, const CRect& rect, COLORREF clrColor=GetSysColor(COLOR_3DFACE));
|
||||
|
||||
// Summary: Destroys a CXTAnimationMemDC object, handles cleanup and de-allocation.
|
||||
virtual ~CXTAnimationMemDC();
|
||||
|
||||
// Input: nType - Type of animation to perform.
|
||||
// nSteps - Number of steps to take during animation.
|
||||
// nAnimationTime - Amount of time to rest, in milliseconds, between each step.
|
||||
// Summary: This member function performs the animation.
|
||||
void Animate(int nType = animateWindowsDefault, int nSteps = 10, int nAnimationTime = 1000);
|
||||
|
||||
// Input: rc - Bounding rectangle
|
||||
// pDestDC - Pointer to device context you must draw to.
|
||||
// pSrcDC - Device context that contains the bitmap you must take.
|
||||
// nType - Type of animation to perform. For custom animation you must use
|
||||
// numbers greater than 6.
|
||||
// nSteps - Number of steps to take during animation.
|
||||
// nAnimationTime - Amount of time to rest, in milliseconds, between each step.
|
||||
// Summary: This member implements default animation effects - Fade, Slide and Unfold.
|
||||
// You can add new animation effects to call SetCustomAnimation member.
|
||||
static void DefaultAnimation(CRect rc, CDC* pDestDC, CDC* pSrcDC, int nType, int nSteps, int nAnimationTime);
|
||||
|
||||
// Input: pCustom - pointer to custom animation function.
|
||||
// Example: <pre>
|
||||
// int CMainFrame::OnCreate()
|
||||
// {
|
||||
// CXTCoolMenu::m_nAnimationType = 10; // our animation type
|
||||
// CXTAnimationMemDC::SetCustomAnimation(CustomAnimation); // custom animation procedure.
|
||||
// ...
|
||||
// }
|
||||
// ...
|
||||
// void CMainFrame::CustomAnimation(CRect rc, CDC* pDestDC, CDC* pSrcDC, int nType, int nSteps, int nAnimationTime)
|
||||
// {
|
||||
// if (nType == 10)
|
||||
// {
|
||||
// // do custom animation
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// CXTAnimationMemDC::DefaultAnimation(rc, pDestDC, pSrcDC, nType, nSteps, nAnimationTime);
|
||||
// }
|
||||
// }
|
||||
// </pre>
|
||||
// Summary: Call this member function to setup new Animation effects.
|
||||
// You must call DefaultAnimation in your function.
|
||||
// See Also: xtAnimationProc, ANIMATIONTYPE
|
||||
static void SetCustomAnimation(xtAnimationProc pCustom);
|
||||
|
||||
private:
|
||||
static xtAnimationProc m_pCustomAnimation;
|
||||
};
|
||||
|
||||
#endif // !defined(___XTANIMATIONMEMDC_H__)
|
||||
251
Editor/XT/Include/XTBrowseDialog.h
Normal file
251
Editor/XT/Include/XTBrowseDialog.h
Normal file
@@ -0,0 +1,251 @@
|
||||
// XTBrowseDialog.h: interface for the CXTBrowseDialog class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTBROWSEDIALOG_H__)
|
||||
#define __XTBROWSEDIALOG_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTBrowseDialog is derived from the BROWSEINFO structure. It is used
|
||||
// to display a directory chooser dialog using shell extensions. The
|
||||
// CXTBrowseDialog class allows you to configure various options, including
|
||||
// setting the dialog's title, or assigning a callback function for defining
|
||||
// folder display and file filtering styles.
|
||||
class _XT_EXT_CLASS CXTBrowseDialog : protected BROWSEINFO
|
||||
{
|
||||
public:
|
||||
|
||||
// Input: pParent - Points to a CWnd object that represents the parent
|
||||
// window for the browse dialog.
|
||||
// Summary: Constructs a CXTBrowseDialog object.
|
||||
CXTBrowseDialog(CWnd* pParent=NULL);
|
||||
|
||||
// Summary: Destroys a CXTBrowseDialog object, handles cleanup and de-allocation.
|
||||
virtual ~CXTBrowseDialog();
|
||||
|
||||
protected:
|
||||
|
||||
// Summary: NULL terminated string that represents the selected directory.
|
||||
TCHAR m_szSelPath[MAX_PATH];
|
||||
|
||||
public:
|
||||
|
||||
// Returns: IDOK if the OK button was pressed, otherwise returns IDCANCEL.
|
||||
// Summary: Call this member function to invoke the browse dialog box and return
|
||||
// the dialog box result when done.
|
||||
INT_PTR DoModal();
|
||||
|
||||
// Input: hWnd - Handle to the owner window for the dialog box.
|
||||
// Summary: Call this member function to set the owner window for the dialog box.
|
||||
void SetOwner(HWND hWnd);
|
||||
|
||||
// Returns: An HWND handle.
|
||||
// Summary: Call this member function to get an HWND handle to the owner window
|
||||
// for the dialog box.
|
||||
HWND GetOwner();
|
||||
|
||||
// Input: pidl - Address of an ITEMIDLIST structure specifying the location
|
||||
// of the root folder from which to browse. Only the specified
|
||||
// folder and its subfolders appear in the dialog box. This member
|
||||
// can be NULL, in which case, the namespace root (the desktop folder)
|
||||
// is used.
|
||||
// Summary: Call this member function to set the address of an ITEMIDLIST structure
|
||||
// which specifies the location of the root folder from which to browse.
|
||||
void SetPidlRoot(LPCITEMIDLIST pidl);
|
||||
|
||||
// Returns: The address of the ITEMIDLIST structure that was specified for the
|
||||
// location of the root folder.
|
||||
// Summary: Call this member function to return the address of the ITEMIDLIST
|
||||
// structure that was specified for the location of the root folder.
|
||||
LPCITEMIDLIST GetPidlRoot();
|
||||
|
||||
// Input: szDisplayName - Address of a buffer to receive the display name of the
|
||||
// folder selected by the user. The size of this buffer is assumed to be
|
||||
// MAX_PATH bytes.
|
||||
// Summary: Call this member function to set the address for the display name
|
||||
// the dialog box will use.
|
||||
void SetDisplayName(TCHAR* szDisplayName);
|
||||
|
||||
// Returns: The display name that is used by the browse dialog box.
|
||||
// Summary: Call this member function to return the display name that is used
|
||||
// by the browse dialog box.
|
||||
LPCTSTR GetDisplayName();
|
||||
|
||||
// Input: szTitle - Address of a null-terminated string that is displayed above the
|
||||
// tree view control in the dialog box. This string can be used to
|
||||
// specify instructions to the user.
|
||||
// Summary: Call this member function to set the title for the browse dialog box.
|
||||
void SetTitle(TCHAR* szTitle);
|
||||
|
||||
// Returns: A NULL terminated string that represents the title that was set for the dialog box.
|
||||
// Summary: Call this member function to return a NULL terminated string that represents
|
||||
// the title that was set for the dialog box.
|
||||
LPCTSTR GetTitle();
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: uf - Flags specifying the options for the dialog box. This member can
|
||||
// include zero or a combination of the following values:
|
||||
// [ul]
|
||||
// [li]<b>BIF_BROWSEFORCOMPUTER</b> Only return computers. If the user
|
||||
// selects anything other than a computer, the OK button is grayed.[/li]
|
||||
// [li]<b>BIF_BROWSEFORPRINTER</b> Only return printers. If the user
|
||||
// selects anything other than a printer, the OK button is grayed.[/li]
|
||||
// [li]<b>BIF_BROWSEINCLUDEFILES</b> The browse dialog will display
|
||||
// files as well as folders.[/li]
|
||||
// [li]<b>BIF_DONTGOBELOWDOMAIN</b> Do not include network folders
|
||||
// below the domain level in the tree view control.[/li]
|
||||
// [li]<b>BIF_EDITBOX</b> Version 4.71. The browse dialog includes an
|
||||
// edit control in which the user can type the name of an item.[/li]
|
||||
// [li]<b>BIF_RETURNFSANCESTORS</b> Only return file system ancestors.
|
||||
// If the user selects anything other than a file system ancestor,
|
||||
// the OK button is grayed.[/li]
|
||||
// [li]<b>BIF_RETURNONLYFSDIRS</b> Only return file system directories.
|
||||
// If the user selects folders that are not part of the file system,
|
||||
// the OK button is grayed.[/li]
|
||||
// [li]<b>BIF_STATUSTEXT</b> Include a status area in the dialog box.
|
||||
// The callback function can set the status text by sending messages
|
||||
// to the dialog box.[/li]
|
||||
// [li]<b>BIF_VALIDATE</b> Version 4.71. If the user types an invalid
|
||||
// name into the edit box, the browse dialog will call the application's
|
||||
// BrowseCallbackProc with the BFFM_VALIDATEFAILED message. This
|
||||
// flag is ignored if BIF_EDITBOX is not specified.[/li]
|
||||
// [/ul]
|
||||
// Summary: Call this member function to set the flags for specifying the options
|
||||
// for the browse dialog box.
|
||||
void SetOptions(UINT uf);
|
||||
|
||||
// Returns: The flags specifying the options that have been set for the dialog box.
|
||||
// Summary: Call this member function to return the flags specifying the options
|
||||
// that have been set for the dialog box.
|
||||
UINT GetOptions();
|
||||
|
||||
// Input: pf - Address of an application-defined function that the dialog box calls
|
||||
// when an event occurs. For more information, see the BrowseCallbackProc
|
||||
// function. This member can be NULL.
|
||||
// Summary: Call this member function to define the address for the BrowseCallbackProc
|
||||
// function to be called when an event occurs.
|
||||
void SetCallback(BFFCALLBACK pf);
|
||||
|
||||
// Returns: The address for the BrowseCallbackProc function that is called when an event occurs.
|
||||
// Summary: Call this member function to return the address for the BrowseCallbackProc
|
||||
// function that is called when an event occurs.
|
||||
BFFCALLBACK GetCallback();
|
||||
|
||||
// Input: lp - Application-defined value that the dialog box passes to the callback
|
||||
// function, if one is specified.
|
||||
// Summary: Call this member function to set the application data that is passed to
|
||||
// the callback function.
|
||||
void SetData(LPARAM lp);
|
||||
|
||||
// Returns: The application data that was set to be passed to the callback function,
|
||||
// if one is specified.
|
||||
// Summary: NEEDS SUMMARY
|
||||
LPARAM GetData();
|
||||
|
||||
// Input: szSelPath - A NULL terminated string that represents the directory that is
|
||||
// selected when the dialog is initially opened. If not set,
|
||||
// GetCurrentDirectory is called to set the directory.
|
||||
// Summary: Call this member function to set the initial path to select when the
|
||||
// browse dialog is first opened.
|
||||
void SetSelPath(TCHAR* szSelPath);
|
||||
|
||||
// Returns: A NULL terminated string representing the selected directory.
|
||||
// Summary: Call this member function to get a NULL terminated string that represents
|
||||
// the currently selected directory.
|
||||
LPCTSTR GetSelPath();
|
||||
|
||||
// Returns: The index to the system image list.
|
||||
// Summary: Call this member function to get the index to the system image list
|
||||
// of the image associated with the selected folder.
|
||||
int GetImage();
|
||||
|
||||
private:
|
||||
|
||||
CString m_strTitle; // default dialog title.
|
||||
|
||||
// Input: hwnd - A handle to a window.
|
||||
// uMsg - The message that is sent to the window.
|
||||
// lParam - Specifies the application-defined data passed by the BrowseCtrlCallback
|
||||
// function.
|
||||
// lpData - Data that is passed into the function.
|
||||
// Returns: An integer value.
|
||||
// Summary: Application-defined callback function used with the SHBrowseForFolder function.
|
||||
// The browse dialog box calls this function to notify it about events. You can
|
||||
// define your own callback function by using the SetCallback method.
|
||||
static int CALLBACK BrowseCtrlCallback(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTBrowseDialog::SetOwner(HWND hWnd) {
|
||||
hwndOwner = hWnd;
|
||||
}
|
||||
AFX_INLINE HWND CXTBrowseDialog::GetOwner() {
|
||||
return hwndOwner;
|
||||
}
|
||||
AFX_INLINE void CXTBrowseDialog::SetPidlRoot(LPCITEMIDLIST pidl) {
|
||||
pidlRoot = pidl;
|
||||
}
|
||||
AFX_INLINE LPCITEMIDLIST CXTBrowseDialog::GetPidlRoot() {
|
||||
return pidlRoot;
|
||||
}
|
||||
AFX_INLINE void CXTBrowseDialog::SetDisplayName(TCHAR* szDisplayName) {
|
||||
pszDisplayName = szDisplayName;
|
||||
}
|
||||
AFX_INLINE LPCTSTR CXTBrowseDialog::GetDisplayName() {
|
||||
return pszDisplayName;
|
||||
}
|
||||
AFX_INLINE void CXTBrowseDialog::SetTitle(TCHAR* szTitle) {
|
||||
lpszTitle = szTitle;
|
||||
}
|
||||
AFX_INLINE LPCTSTR CXTBrowseDialog::GetTitle() {
|
||||
return lpszTitle;
|
||||
}
|
||||
AFX_INLINE void CXTBrowseDialog::SetOptions(UINT uf) {
|
||||
ulFlags = uf;
|
||||
}
|
||||
AFX_INLINE UINT CXTBrowseDialog::GetOptions() {
|
||||
return ulFlags;
|
||||
}
|
||||
AFX_INLINE void CXTBrowseDialog::SetCallback(BFFCALLBACK pf) {
|
||||
lpfn = pf;
|
||||
}
|
||||
AFX_INLINE BFFCALLBACK CXTBrowseDialog::GetCallback() {
|
||||
return lpfn;
|
||||
}
|
||||
AFX_INLINE void CXTBrowseDialog::SetData(LPARAM lp) {
|
||||
lParam = lp;
|
||||
}
|
||||
AFX_INLINE LPARAM CXTBrowseDialog::GetData() {
|
||||
return lParam;
|
||||
}
|
||||
AFX_INLINE void CXTBrowseDialog::SetSelPath(TCHAR* szSelPath) {
|
||||
_tcscpy(m_szSelPath, szSelPath);
|
||||
}
|
||||
AFX_INLINE LPCTSTR CXTBrowseDialog::GetSelPath() {
|
||||
return m_szSelPath;
|
||||
}
|
||||
AFX_INLINE int CXTBrowseDialog::GetImage() {
|
||||
return iImage;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(__XTBROWSEDIALOG_H__)
|
||||
259
Editor/XT/Include/XTBrowseEdit.h
Normal file
259
Editor/XT/Include/XTBrowseEdit.h
Normal file
@@ -0,0 +1,259 @@
|
||||
// XTBrowseEdit.h : interface for the CXTBrowseEdit class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTBROWSEEDIT_H__)
|
||||
#define __XTBROWSEEDIT_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
class CXTBrowseBtn;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTBrowseEdit is a CXTEdit derived class. This class also has a push
|
||||
// button associated with it. The control can be used to search for directories
|
||||
// and files, or activate a popup menu.
|
||||
class _XT_EXT_CLASS CXTBrowseEdit : public CXTEdit
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTBrowseEdit)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTBrowseEdit object.
|
||||
CXTBrowseEdit();
|
||||
|
||||
// Summary: Destroys a CXTBrowseEdit object, handles cleanup and de-allocation.
|
||||
virtual ~CXTBrowseEdit();
|
||||
|
||||
protected:
|
||||
|
||||
int m_nGap; // Distance between the button and edit control.
|
||||
bool m_bBrowsing; // true if in browse operation.
|
||||
BOOL m_bOpenFileDialog; // TRUE for Open File dialog, FALSE for Save as. See SetDlgOpenFile(...).
|
||||
UINT m_nMenu; // Popup menu ID.
|
||||
UINT m_nSubMenuIndx; // Index of a popup submenu.
|
||||
CWnd* m_pParentWnd; // A CWnd pointer that represents the parent of the edit control.
|
||||
DWORD m_dwFlags; // File dialog styles.
|
||||
DWORD m_dwBStyle; // Search type.
|
||||
DWORD m_dwInitSignature; // Used for one-time initialization.
|
||||
CString m_strDefExt; // Default file extension.
|
||||
CString m_strFileName; // Default file name.
|
||||
CString m_strFilter; // Default file filter.
|
||||
CString m_strTitle; // Directory dialog title.
|
||||
CFileDialog* m_pFileDialog; // Points to a valid CFileDialog object.
|
||||
CXTBrowseBtn* m_pBrowseBtn; // Pointer to a push button.
|
||||
|
||||
public:
|
||||
|
||||
// Returns: true if the control is displaying a File Open dialog or popup menu.
|
||||
// Summary: Call this member function to determine if the browse edit control is in
|
||||
// the middle of a browse operation.
|
||||
bool IsBrowsing();
|
||||
|
||||
// Input: nGap - Gap, in pixels, between the browse button and edit window.
|
||||
// Summary: Call this member function to set the gap between the edit window and the
|
||||
// browse button.
|
||||
void SetGap(int nGap);
|
||||
|
||||
// Input: pFileDialog - Points to the CFileDialog object that will replace the
|
||||
// standard File Open dialog.
|
||||
// Summary: This member function will set a CFileDialog derived class object to be
|
||||
// the file open dialog.
|
||||
virtual void SetFileDialog(CFileDialog* pFileDialog);
|
||||
|
||||
// Input: bOpenFileDialog - Set to TRUE to construct a File Open dialog box, or
|
||||
// FALSE to construct a File Save as dialog box.
|
||||
// Summary: This member function will set the File Open dialog style.
|
||||
virtual void SetDlgOpenFile(BOOL bOpenFileDialog=TRUE);
|
||||
|
||||
// Input: strDefExt - Points to a NULL terminated string that represents the
|
||||
// default file extension to be used with the File Open dialog.
|
||||
// Summary: This member function sets the default extension for the File Open dialog.
|
||||
virtual void SetDlgDefExt(LPCTSTR strDefExt=NULL);
|
||||
|
||||
// Input: strFileName - Points to a NULL terminated string that represents the
|
||||
// default file name to be used with the File Open dialog.
|
||||
// Summary: This member function sets the default file name for the File Open dialog.
|
||||
virtual void SetDlgFileName(LPCTSTR strFileName=NULL);
|
||||
|
||||
// Input: dwFlags - The desired OFN_ styles for the File Open dialog.
|
||||
// Summary: This member function sets the style flags for the File Open dialog.
|
||||
virtual void SetDlgStyle(DWORD dwFlags=OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT);
|
||||
|
||||
// Input: strFilter - Points to a NULL terminated string that represents the file
|
||||
// filter used by the File Open dialog.
|
||||
// Summary: This member function sets the file filter for the File Open dialog.
|
||||
virtual void SetDlgFilter(LPCTSTR strFilter=NULL);
|
||||
|
||||
// Input: pParentWnd - Points to a CWnd object that represents the owner window
|
||||
// for this control.
|
||||
// Summary: This member function sets the owner for the File Open dialog.
|
||||
virtual void SetDlgOwner(CWnd* pParentWnd=NULL);
|
||||
|
||||
// Input: strTitle - Points to a NULL terminated string the represents the title
|
||||
// of the "browse for directory" dialog.
|
||||
// Summary: This member function sets the title for the directory dialog.
|
||||
virtual void SetDlgTitle(LPCTSTR strTitle=NULL);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwBStyle - A DWORD value that represents the type of search to perform. It can
|
||||
// be any one of the following styles:
|
||||
// [ul]
|
||||
// [li]<b>BES_XT_CHOOSEDIR</b> Display the choose folder dialog.[/li]
|
||||
// [li]<b>BES_XT_CHOOSEFILE</b> Display the choose file dialog.[/li]
|
||||
// [li]<b>BES_XT_POPUPMENU</b> Display a user defined context menu.[/li]
|
||||
// [/ul]
|
||||
// nMenu - If 'dwBStyle' contains the BES_XT_POPUPMENU flag, then 'nMenu' represents
|
||||
// the resource ID of a popup menu. Otherwise this value is ignored.
|
||||
// nSubMenuIndx - Index of submenu to display.
|
||||
// Summary: This member function sets the current search type for the control.
|
||||
virtual void SetBrowseStyle(DWORD dwBStyle,UINT nMenu=0,int nSubMenuIndx=0);
|
||||
|
||||
// Summary: This member function is called whenever the browse button is pressed,
|
||||
// and can be overridden to perform custom browse functions.
|
||||
virtual void OnBrowse();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTBrowseEdit)
|
||||
protected:
|
||||
virtual void PreSubclassWindow();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual void ChooseDirectory();
|
||||
virtual void ChooseFile();
|
||||
virtual void PopupMenu();
|
||||
virtual void PositionBrowseButton(bool bSizeEdit=false);
|
||||
|
||||
// Summary: Defers control initialization
|
||||
void DeferInitialUpdate();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTBrowseEdit)
|
||||
afx_msg void OnEnable(BOOL bEnable);
|
||||
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
|
||||
afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTBrowseEdit::SetGap(int nGap) {
|
||||
ASSERT(nGap >= 0); m_nGap = nGap;
|
||||
}
|
||||
AFX_INLINE void CXTBrowseEdit::SetFileDialog(CFileDialog *pFileDialog/*=NULL*/) {
|
||||
m_pFileDialog = pFileDialog;
|
||||
}
|
||||
AFX_INLINE void CXTBrowseEdit::SetDlgOpenFile(BOOL bOpenFileDialog/*=TRUE*/) {
|
||||
m_bOpenFileDialog = bOpenFileDialog;
|
||||
}
|
||||
AFX_INLINE void CXTBrowseEdit::SetDlgDefExt(LPCTSTR strDefExt/*=NULL*/) {
|
||||
m_strDefExt = strDefExt;
|
||||
}
|
||||
AFX_INLINE void CXTBrowseEdit::SetDlgFileName(LPCTSTR strFileName/*=NULL*/) {
|
||||
m_strFileName = strFileName;
|
||||
}
|
||||
AFX_INLINE void CXTBrowseEdit::SetDlgStyle(DWORD dwFlags/*=OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT*/) {
|
||||
m_dwFlags = dwFlags;
|
||||
}
|
||||
AFX_INLINE void CXTBrowseEdit::SetDlgFilter(LPCTSTR strFilter/*=NULL*/) {
|
||||
m_strFilter = strFilter;
|
||||
}
|
||||
AFX_INLINE void CXTBrowseEdit::SetDlgOwner(CWnd* pParentWnd/*=NULL*/) {
|
||||
m_pParentWnd = pParentWnd;
|
||||
}
|
||||
AFX_INLINE void CXTBrowseEdit::SetDlgTitle(LPCTSTR strTitle/*=NULL*/) {
|
||||
m_strTitle = strTitle;
|
||||
}
|
||||
AFX_INLINE void CXTBrowseEdit::SetBrowseStyle(DWORD dwBStyle, UINT nMenu, int nSubMenuIndx) {
|
||||
m_dwBStyle = dwBStyle; m_nMenu = nMenu; m_nSubMenuIndx = nSubMenuIndx;
|
||||
}
|
||||
AFX_INLINE bool CXTBrowseEdit::IsBrowsing() {
|
||||
return m_bBrowsing;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTItemEdit is a CXTBrowseEdit derived class. It is used to create
|
||||
// a CXTItemEdit window that can be used as an "in-place" edit field that
|
||||
// can be dynamically created for controls such as a list box.
|
||||
class _XT_EXT_CLASS CXTItemEdit : public CXTBrowseEdit
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTItemEdit)
|
||||
|
||||
// Used internally to determine if a WM_CLOSE message has been sent.
|
||||
|
||||
bool m_bClosePosted;
|
||||
|
||||
public:
|
||||
|
||||
// Input: pParent - Points to the parent window.
|
||||
// rect - Size of the edit item.
|
||||
// strWindowText - Text to be initially displayed in the edit field.
|
||||
// dwBStyle - Specifies the browse edit style for the in-place edit field.
|
||||
// See CXTBrowseEdit::SetBrowseStyle for available styles.
|
||||
// bAutoDelete - Set to true if the object is to be self deleting.
|
||||
// Summary: Constructs a CXTItemEdit object that can be used as an "in-place" edit
|
||||
// field, and can be dynamically created for controls such as a list box.
|
||||
CXTItemEdit(CWnd* pParent, const CRect& rect, CString& strWindowText,
|
||||
DWORD dwBStyle=BES_XT_CHOOSEDIR, bool bAutoDelete=true);
|
||||
|
||||
// Summary: Destroys a CXTItemEdit object, handles cleanup and de-allocation.
|
||||
virtual ~CXTItemEdit();
|
||||
|
||||
public:
|
||||
|
||||
bool m_bModified; // true if the item was modified.
|
||||
bool m_bAutoDelete; // true if self deleting.
|
||||
bool m_bEscapeKey; // true if the edit window was closed with the escape key.
|
||||
CString& m_strWindowText; // The edit controls text.
|
||||
|
||||
public:
|
||||
|
||||
// Summary: This member function is called whenever the control loses focus.
|
||||
// This will destroy the window, and notify the parent via WM_COMMAND
|
||||
// that the editing has been completed. The two possible commands are:
|
||||
// ON_BEN_XT_LABELEDITEND and ON_BEN_XT_LABELEDITCANCEL;
|
||||
virtual void EndLabelEdit();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTItemEdit)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
protected:
|
||||
virtual void PostNcDestroy();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTItemEdit)
|
||||
afx_msg void OnKillFocus(CWnd* pNewWnd);
|
||||
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTBROWSEEDIT_H__)
|
||||
315
Editor/XT/Include/XTButton.h
Normal file
315
Editor/XT/Include/XTButton.h
Normal file
@@ -0,0 +1,315 @@
|
||||
// XTButton.h : interface for the CXTButton class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTBUTTON_H__)
|
||||
#define __XTBUTTON_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTButton is a CButton derived class. It is used to create flat style
|
||||
// and image buttons. This control has several features including flat,
|
||||
// semi-flat and three dimensional borders.
|
||||
class _XT_EXT_CLASS CXTButton : public CButton
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTButton)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTButton object.
|
||||
CXTButton();
|
||||
|
||||
// Summary: Destroys a CXTButton object, handles cleanup and de-allocation.
|
||||
virtual ~CXTButton();
|
||||
|
||||
protected:
|
||||
|
||||
int m_nBorderGap; // Gap between the button edge and the image.
|
||||
int m_nImageGap; // Gap between the button text and the image.
|
||||
BOOL m_bHilite; // TRUE if the button is highlighted.
|
||||
BOOL m_bUserPosition; // TRUE if the user has defined the XY coordinates for the image and text.
|
||||
BOOL m_bLBtnDown; // TRUE if the left mouse button is pressed.
|
||||
BOOL m_bAltColor; // TRUE if user defined colors are used.
|
||||
BOOL m_bPainted; // Used during paint operations.
|
||||
BOOL m_bChecked; // TRUE if the button is checked.
|
||||
CSize m_sizeImage; // Initial size of the button.
|
||||
DWORD m_dwxStyle; // The style of the button. See SetXButtonStyle().
|
||||
HICON m_hIcon; // Handle to the icon associated with the button.
|
||||
HICON m_hIconPushed; // Handle to the icon associated with the button when it is pressed.
|
||||
CPoint m_ptImage; // XY location of the button image.
|
||||
CPoint m_ptText; // XY location of the button text.
|
||||
HBITMAP m_hBitmap; // Bitmap associated with the button.
|
||||
HBITMAP m_hBitmapMono; // Disabled bitmap associated with the button.
|
||||
COLORREF m_clrBtnText; // An RGB value that represents the button text color.
|
||||
COLORREF m_clr3DFace; // An RGB value that represents the button face color.
|
||||
COLORREF m_clr3DHilight; // An RGB value that represents the 3D border highlight color.
|
||||
COLORREF m_clr3DShadow; // An RGB value that represents the 3D border shadow color.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// XP Flat colors
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
BOOL m_bXPFUserColors; // TRUE if the user set custom XP-Flat colors.
|
||||
DWORD m_dwInitSignature; // Used for one-time initialization.
|
||||
COLORREF m_clrXPFHighlight; // An RGB value that represents the background color for highlighted buttons in XP-Flat mode.
|
||||
COLORREF m_clrXPFPressed; // An RGB value that represents the background color for pressed buttons in XP-Flat mode.
|
||||
COLORREF m_clrXPFBorder; // An RGB value that represents the frame color for highlighted/pressed buttons in XP-Flat mode.
|
||||
|
||||
public:
|
||||
|
||||
// Input: bChecked - Specifies whether the button is to be checked. TRUE will
|
||||
// check the button. FALSE will uncheck it.
|
||||
// Summary: This member function sets the highlighting state of a button control.
|
||||
// This is the same as its CButton counterpart, except the m_bChecked flag
|
||||
// is set. This is done because MFC does not recognize the button as being
|
||||
// checked unless it a radio or check box.
|
||||
void SetStateX(BOOL bChecked);
|
||||
|
||||
// Input: nGap - Amount, in pixels, of the gap between the button edge and the image.
|
||||
// Returns: The previous border gap value.
|
||||
// Summary: This member function will set the gap between the button's edge and
|
||||
// the image.
|
||||
int SetBorderGap(int nGap);
|
||||
|
||||
// Input: nGap - Amount, in pixels, of the gap between the button text and the image.
|
||||
// Returns: The previous border gap value.
|
||||
// Summary: This member function will set the gap between the button's text and
|
||||
// the image.
|
||||
int SetImageGap(int nGap);
|
||||
|
||||
// Input: clr3DFace - An RGB value that represents the user defined face color for
|
||||
// three dimensional display elements.
|
||||
// clr3DHilight - An RGB value that represents the user defined highlight
|
||||
// color for three dimensional display elements (edges facing the light
|
||||
// source.)
|
||||
// clr3DShadow - An RGB value that represents the user defined shadow color
|
||||
// for three dimensional display elements (edges facing away from the
|
||||
// light source).
|
||||
// clrBtnText - An RGB value that represents the user defined text color
|
||||
// on push buttons.
|
||||
// Summary: This method will allow the user to define the default colors for the
|
||||
// background shadow and highlight colors for the button.
|
||||
virtual void SetAlternateColors(COLORREF clr3DFace, COLORREF clr3DHilight, COLORREF clr3DShadow, COLORREF clrBtnText);
|
||||
|
||||
// Input: clrFace - An RGB value that represents the user defined face color.
|
||||
// Summary: This member function sets the default face color for the button.
|
||||
virtual void SetColorFace(COLORREF clrFace);
|
||||
|
||||
// Returns: An RGB value that represents the current face color.
|
||||
// Summary: This member function gets the current face color.
|
||||
virtual COLORREF GetColorFace();
|
||||
|
||||
// Input: clrHilite - An RGB value that represents the user defined highlight color.
|
||||
// Summary: This member function sets the default highlight color for the button.
|
||||
virtual void SetColorHilite(COLORREF clrHilite);
|
||||
|
||||
// Input: clrShadow - An RGB value that represents the user defined shadow color.
|
||||
// Summary: This member function sets the default shadow color for the button.
|
||||
virtual void SetColorShadow(COLORREF clrShadow);
|
||||
|
||||
// Input: clrText - An RGB value that represents the user defined text color.
|
||||
// Summary: This member function sets the default text color for the button.
|
||||
virtual void SetColorText(COLORREF clrText);
|
||||
|
||||
// Input: clrBorder - An RGB value that represents the user defined border color
|
||||
// for the flat button.
|
||||
// clrHighlight - An RGB value that represents the user defined highlight
|
||||
// color for the flat button.
|
||||
// clrPressed - An RGB value that represents the user defined color for when
|
||||
// the flat button is pressed.
|
||||
// Summary: This member function sets the colors for the BS_XT_XPFLAT mode.
|
||||
virtual void SetXPFlatColors(COLORREF clrBorder, COLORREF clrHighlight, COLORREF clrPressed);
|
||||
|
||||
// Input: size - CSize object that represents the size of the icon.
|
||||
// hIcon - Handle to the normal icon.
|
||||
// hIconPushed - Handle to the pressed icon.
|
||||
// bRedraw - Specifies whether the button is to be redrawn. A nonzero value
|
||||
// redraws the button. A zero value does not redraw the button. The button is
|
||||
// redrawn by default.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will set the normal and pushed state icons for
|
||||
// the push button.
|
||||
virtual BOOL SetIcon(CSize size, HICON hIcon, HICON hIconPushed=NULL, BOOL bRedraw=TRUE);
|
||||
|
||||
// Input: size - CSize object that represents the size of the icon.
|
||||
// nID - Resource ID for the normal icon.
|
||||
// nPushedID - Resource ID for the pressed icon.
|
||||
// bRedraw - Specifies whether the button is to be redrawn. A nonzero value
|
||||
// redraws the button. A zero value does not redraw the button. The button is
|
||||
// redrawn by default.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will set the normal and pushed state icons for
|
||||
// the push button.
|
||||
virtual BOOL SetIcon(CSize size, UINT nID, UINT nPushedID=0, BOOL bRedraw=TRUE);
|
||||
|
||||
// Input: size - CSize object that represents the size of the icon.
|
||||
// lpszID - Resource string ID for the normal icon.
|
||||
// lpszPushedID - Resource string ID for the pressed icon.
|
||||
// bRedraw - Specifies whether the button is to be redrawn. A nonzero value
|
||||
// redraws the button. A zero value does not redraw the button. The button is
|
||||
// redrawn by default.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will set the normal and pushed state icons for
|
||||
// the push button.
|
||||
virtual BOOL SetIcon(CSize size, LPCTSTR lpszID, LPCTSTR lpszPushedID=NULL, BOOL bRedraw=TRUE);
|
||||
|
||||
// Input: size - CSize object that represents the size of the bitmap.
|
||||
// nID - Resource ID for the bitmap.
|
||||
// bRedraw - Specifies whether the button is to be redrawn. A nonzero value redraws
|
||||
// the button. A zero value does not redraw the button. The button is redrawn
|
||||
// by default.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will set the bitmap associated with the button.
|
||||
virtual BOOL SetBitmap(CSize size,UINT nID,BOOL bRedraw=TRUE);
|
||||
|
||||
// Input: ptImage - XY location of the image displayed on the button.
|
||||
// ptText - XY location of the text displayed on the button.
|
||||
// bRedraw - Specifies whether the button is to be redrawn. A nonzero value redraws
|
||||
// the button. A zero value does not redraw the button. The button is redrawn
|
||||
// by default.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will set the XY location of the text and image
|
||||
// that is displayed on the push button.
|
||||
virtual BOOL SetTextAndImagePos(CPoint ptImage,CPoint ptText,BOOL bRedraw=TRUE);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwxStyle - Specifies the button style. It can be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>BS_XT_FLAT</b> Draws a flat button.[/li]
|
||||
// [li]<b>BS_XT_SEMIFLAT</b> Draws a semi-flat button.[/li]
|
||||
// [li]<b>BS_XT_TWOROWS</b> Draws images and text that are centered.[/li]
|
||||
// [li]<b>BS_XT_SHOWFOCUS</b> Draws a focus rect when the button
|
||||
// has input focus.[/li]
|
||||
// [li]<b>BS_XT_HILITEPRESSED</b> Highlights the button when pressed.[/li]
|
||||
// [li]<b>BS_XT_XPFLAT</b> Draws a flat button ala Office XP.[/li]
|
||||
// [/ul]
|
||||
// bRedraw - Specifies whether the button is to be redrawn. A nonzero value redraws
|
||||
// the button. A zero value does not redraw the button. The button is redrawn
|
||||
// by default.
|
||||
// Returns: The previous style that was set.
|
||||
// Summary: This member function will set the display style for the button.
|
||||
DWORD SetXButtonStyle(DWORD dwxStyle,BOOL bRedraw=TRUE);
|
||||
|
||||
// Returns: The button styles for this CXTButton object.
|
||||
// Summary: This function returns only the BS_XT_ style values, not any of the
|
||||
// other window styles.
|
||||
virtual DWORD GetXButtonStyle();
|
||||
|
||||
// Summary: This function removes the icon or bitmap from the button. All resources
|
||||
// taken by the image are freed.
|
||||
virtual void ResetImage();
|
||||
|
||||
protected:
|
||||
|
||||
// Input: point - XY location of the text and image that are displayed.
|
||||
// size - Initial size of the image associated with the button.
|
||||
// Summary: This member function will set the proper XY coordinates for the button
|
||||
// text and image.
|
||||
void OffsetPoint(CPoint& point, CSize size);
|
||||
|
||||
// Summary: This member function is called to free all associated GDI resources
|
||||
// that have been allocated.
|
||||
virtual void CleanUpGDI();
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// nState - A UINT value that represents the current state for the button.
|
||||
// rcItem - A CRect reference that represents the current size for the button.
|
||||
// Summary: This member function draws the icon for the button, if any.
|
||||
virtual void DrawButtonIcon(CDC* pDC, UINT nState, CRect& rcItem);
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// nState - A UINT value that represents the current state for the button.
|
||||
// rcItem - A CRect reference that represents the current size for the button.
|
||||
// Summary: This member function will draw the text for the button, if any.
|
||||
virtual void DrawButtonText(CDC* pDC, UINT nState, CRect& rcItem);
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// nState - A UINT value that represents the current state for the button.
|
||||
// rcItem - A CRect reference that represents the current size for the button.
|
||||
// Summary: This member function will draw the bitmap for the button, if any.
|
||||
virtual void DrawButtonBitmap(CDC* pDC, UINT nState, CRect& rcItem);
|
||||
|
||||
// Input: bRemoveAmpersand - TRUE to remove the '&' used for mnemonics.
|
||||
// Returns: A CString object that represents the button's text.
|
||||
// Summary: Call this member function to return the buttons text minus the '&'.
|
||||
virtual CString GetButtonText(BOOL bRemoveAmpersand);
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// nState - A UINT value that represents the current state for the button.
|
||||
// rcItem - A CRect reference that represents the current size for the button.
|
||||
// bHasPushedImage - Indicates if the button has a separate image for the
|
||||
// pushed state.
|
||||
// Returns: The top-left position for the button image.
|
||||
// Summary: Call this member function to calculate the position of the button image.
|
||||
virtual CPoint CalculateImagePosition(CDC* pDC, UINT nState, CRect& rcItem, bool bHasPushedImage);
|
||||
|
||||
|
||||
// Input: bDepressed - TRUE if the button is pressed, otherwise FALSE.
|
||||
// Summary: Call this helper function to set the pressed state and redraw the button.
|
||||
void NoteButtonDepressed(BOOL bDepressed);
|
||||
|
||||
// Summary: Defers control initialization
|
||||
void DeferInitialUpdate();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTButton)
|
||||
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
|
||||
virtual void PreSubclassWindow();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTButton)
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnTimer(UINT_PTR nIDEvent);
|
||||
afx_msg void OnSysColorChange();
|
||||
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnDestroy();
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE int CXTButton::SetImageGap(int nGap) {
|
||||
int nOldGap = m_nImageGap; m_nImageGap = nGap; return nOldGap;
|
||||
}
|
||||
AFX_INLINE int CXTButton::SetBorderGap(int nGap) {
|
||||
int nOldGap = m_nBorderGap; m_nBorderGap = nGap; return nOldGap;
|
||||
}
|
||||
AFX_INLINE DWORD CXTButton::GetXButtonStyle() {
|
||||
ASSERT(::IsWindow(m_hWnd)); return m_dwxStyle;
|
||||
}
|
||||
AFX_INLINE void CXTButton::SetStateX(BOOL bChecked) {
|
||||
CButton::SetState(bChecked); m_bChecked = bChecked;
|
||||
}
|
||||
AFX_INLINE COLORREF CXTButton::GetColorFace() {
|
||||
return m_clr3DFace;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTBUTTON_H__)
|
||||
172
Editor/XT/Include/XTCBarDialog.h
Normal file
172
Editor/XT/Include/XTCBarDialog.h
Normal file
@@ -0,0 +1,172 @@
|
||||
// XTCBarDialog.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTCBARDIALOG_H__)
|
||||
#define __XTCBARDIALOG_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTCBarDialog is a, CXTResizeDialog derived class. The CXTCBarDialog class is used
|
||||
// to create a dialog that supports toolbars, status bars and menu commands similar to the way
|
||||
// a CFrameWnd class would handle this.
|
||||
class _XT_EXT_CLASS CXTCBarDialog : public CXTResizeDialog
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTCBarDialog)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTCBarDialog object. To construct a resource-based modal
|
||||
// dialog box, call either public form of the constructor. One form of the
|
||||
// constructor provides access to the dialog resource by template name. The
|
||||
// other constructor provides access by template ID number, usually with an
|
||||
// <b>IDD_</b> prefix (for example, IDD_DIALOG1).
|
||||
//
|
||||
// To construct a modal dialog box from a template in memory, first invoke
|
||||
// the parameterless, protected constructor and then call
|
||||
// <b>InitModalIndirect</b>.
|
||||
//
|
||||
// After you construct a modal dialog box with one of the above methods, call
|
||||
// <b>DoModal</b>.
|
||||
//
|
||||
// To construct a modeless dialog box, use the protected form of the
|
||||
// <b>CXTResizeDialog</b> constructor. The constructor is protected
|
||||
// because you must derive your own dialog-box class to implement a modeless
|
||||
// dialog box. Construction of a modeless dialog box is a two-step process.
|
||||
// First call the constructor; then call the <b>Create</b> member function to
|
||||
// create a resource-based dialog box, or call <b>CreateIndirect</b> to create
|
||||
// the dialog box from a template in memory.
|
||||
CXTCBarDialog();
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: nIDTemplate - Contains the ID number of a dialog-box template resource.
|
||||
// pParentWnd - Points to the parent or owner window object (of type CWnd) to which the dialog object
|
||||
// belongs. If it is <b>NULL</b>, the dialog object<63>s parent window is set to the main application window.
|
||||
// nFlags - Flags that are to be passed to CXTResize that specify the attributes
|
||||
// of the resizing property page. They can be one or more of the following,
|
||||
// and can be combined using the or (|) operator:
|
||||
// [ul]
|
||||
// [li]<b>SZ_NOSIZEICON</b> Do not add size icon.[/li]
|
||||
// [li]<b>SZ_NOHORISONTAL</b> No horizontal resizing.[/li]
|
||||
// [li]<b>SZ_NOVERTICAL</b> No vertical resizing.[/li]
|
||||
// [li]<b>SZ_NOMINSIZE</b> Do not require a minimum size.[/li]
|
||||
// [li]<b>SZ_NOCLIPCHILDREN</b> Do not set clip children style.[/li]
|
||||
// [li]<b>SZ_NOTRANSPARENTGROUP</b> Do not set transparent style
|
||||
// for group boxes.[/li]
|
||||
// [/ul]
|
||||
// Summary: Constructs a CXTCBarDialog object. To construct a resource-based modal dialog box, call either
|
||||
// public form of the constructor. One form of the constructor provides access to the dialog resource
|
||||
// by template name. The other constructor provides access by template ID number, usually with an
|
||||
// <b>IDD_</b> prefix (for example, IDD_DIALOG1).
|
||||
//
|
||||
// To construct a modal dialog box from a template in memory, first invoke the parameterless, protected
|
||||
// constructor and then call <b>InitModalIndirect</b>.
|
||||
//
|
||||
// After you construct a modal dialog box with one of the above methods, call <b>DoModal</b>.
|
||||
//
|
||||
// To construct a modeless dialog box, use the protected form of the <b>CXTResizeDialog</b> constructor. The constructor
|
||||
// is protected because you must derive your own dialog-box class to implement a modeless dialog box.
|
||||
// Construction of a modeless dialog box is a two-step process. First call the constructor; then call the
|
||||
// <b>Create</b> member function to create a resource-based dialog box, or call <b>CreateIndirect</b> to
|
||||
// create the dialog box from a template in memory.
|
||||
CXTCBarDialog(UINT nIDTemplate,CWnd* pParentWnd = NULL,const UINT nFlags = 0);
|
||||
|
||||
protected:
|
||||
|
||||
UINT m_nIDTracking; // Resource id of the string command currently displayed in the status bar area.
|
||||
UINT m_nIDLastMessage; // Resource id of the last string command displayed in the status bar area.
|
||||
CPtrList m_listControlBars; // Array of control bars currently owned by the dialog.
|
||||
CXTCoolMenu m_hookMenu; // Handles the display of old-style 'cool' menus.
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTCBarDialog)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Input: nIDToolBars - Array of toolbar resource IDs. The cool menu will use
|
||||
// the toolbar commands to map the icons placed next to the corresponding
|
||||
// menu commands.
|
||||
// nSize - Size of the array of toolbars.
|
||||
// Summary: Call this member function to install cool menus for your application.
|
||||
// Cool menus are menus that appear with icons next to the menu titles.
|
||||
// Pass in your toolbar resource array to initialize.
|
||||
virtual void InstallCoolMenus(const UINT* nIDToolBars, int nSize);
|
||||
|
||||
// Input: nIDToolBar - Toolbar resource ID. The cool menu will use the toolbar
|
||||
// commands to map the icons placed next to the corresponding menu commands.
|
||||
// Summary: Call this member function to install cool menus for your application.
|
||||
// Cool menus are menus that appear with icons next to the menu titles.
|
||||
// Pass in your toolbar resource to initialize.
|
||||
virtual void InstallCoolMenus(const UINT nIDToolBar);
|
||||
|
||||
// Summary: Called by the dialog when the standard control bars are toggled on or off
|
||||
// or when the dialog window is resized. The default implementation of this
|
||||
// member function calls the <b>CWnd</b> member function <b>RepositionBars</b>
|
||||
// to reposition all the control bars in the dialog.
|
||||
//
|
||||
// Override this member function to control the appearance and behavior of
|
||||
// control bars after the layout of the frame window has changed. For example,
|
||||
// call it when you turn control bars on or off or add another control bar.
|
||||
virtual void RecalcBarLayout();
|
||||
|
||||
// Returns: A CXTStatusBar pointer that represents the status bar associated with the
|
||||
// dialog.
|
||||
// Summary: Call this member function to retrieve a pointer to the status bar associated
|
||||
// with the dialog.
|
||||
virtual CXTStatusBar* GetMessageBar();
|
||||
|
||||
// Returns: A CXTMenuBar pointer that represents the menu bar associated with the dialog.
|
||||
// Summary: Call this member function to retrieve a pointer to the menu bar associated
|
||||
// with the dialog.
|
||||
virtual CXTMenuBar* GetMenuBar();
|
||||
|
||||
// Input: pBar - Pointer to the control bar to be shown or hidden.
|
||||
// bShow - If <b>TRUE</b>, specifies that the control bar is to be shown. If
|
||||
// <b>FALSE</b>, specifies that the control bar is to be hidden.
|
||||
// bDelay - If <b>TRUE</b>, delay showing the control bar. If <b>FALSE</b>,
|
||||
// show the control bar immediately.
|
||||
// Summary: Call this member function to show or hide the control bar.
|
||||
virtual void ShowControlBar(CControlBar* pBar, BOOL bShow, BOOL bDelay);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTCBarDialog)
|
||||
afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
|
||||
afx_msg void OnEnterIdle(UINT nWhy, CWnd* pWho);
|
||||
afx_msg void OnMenuSelect(UINT nItemID, UINT nFlags, HMENU hSysMenu);
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnSetMessageString(WPARAM wParam, LPARAM lParam = 0L);
|
||||
afx_msg LRESULT OnPopMessageString(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg void OnUpdateKeyIndicator(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateControlBarMenu(CCmdUI* pCmdUI);
|
||||
afx_msg BOOL OnBarCheck(UINT nID);
|
||||
afx_msg LRESULT OnKickIdle(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(__XTCBARDIALOG_H__)
|
||||
129
Editor/XT/Include/XTCallbacks.h
Normal file
129
Editor/XT/Include/XTCallbacks.h
Normal file
@@ -0,0 +1,129 @@
|
||||
// XTCallbacks.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTCALLBACKS_H__)
|
||||
#define __XTCALLBACKS_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
// Summary: This class defines a point of listener/callback registration.
|
||||
// Each listener can later be notified.
|
||||
template <class T, int MAXCOUNT>
|
||||
class CXTCallbacks
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: A type of callback function, takes a parameter that is passed to notify() function
|
||||
typedef void (CObject::*NOTIFYCB)(T caller);
|
||||
|
||||
private:
|
||||
|
||||
// Summary: Callback descriptor
|
||||
struct CXTCbParam
|
||||
{
|
||||
DWORD m_receipt; // Registration receipt or 0 if this descriptor is not initialized yet
|
||||
CObject* m_listener; // Listener
|
||||
NOTIFYCB m_cb; // Callback
|
||||
|
||||
CXTCbParam()
|
||||
: m_listener(0)
|
||||
, m_cb(0)
|
||||
, m_receipt(0)
|
||||
{ }
|
||||
};
|
||||
|
||||
DWORD m_signatureSeed; // A seed for generating signatures
|
||||
CXTCbParam m_params[MAXCOUNT]; // Array of registered callbacks, maxed out as specified in template declaration
|
||||
|
||||
// Operations
|
||||
|
||||
public:
|
||||
|
||||
CXTCallbacks()
|
||||
: m_signatureSeed(0)
|
||||
{}
|
||||
|
||||
|
||||
// Input: listener - a listener on which to invoke the callback
|
||||
// cb - listener's method to invoke
|
||||
// Returns: Its registration receipt or 0 if no more space
|
||||
// Summary: Adds a callback,
|
||||
DWORD Add(CObject* listener, NOTIFYCB cb)
|
||||
{
|
||||
for (int i = 0; i < MAXCOUNT; i++)
|
||||
{
|
||||
if (!m_params[i].m_receipt)
|
||||
{
|
||||
m_params[i].m_cb = cb;
|
||||
m_params[i].m_listener = listener;
|
||||
return (m_params[i].m_receipt = ++m_signatureSeed);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Input: receipt - Registration receipt.
|
||||
// Returns: true if the callback was actually removed.
|
||||
// Summary: Removes a callback by its registration receipt.
|
||||
bool Remove(DWORD receipt)
|
||||
{
|
||||
for (int i = 0; i < MAXCOUNT; i++)
|
||||
{
|
||||
if (m_params[i].m_receipt == receipt)
|
||||
{
|
||||
m_params[i].m_receipt = 0;
|
||||
m_params[i].m_cb = 0;
|
||||
m_params[i].m_listener = 0;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Input: listener - Callback listener.
|
||||
// Returns: true if a callback(s) actually removed
|
||||
// Summary: Removes all callbacks registered with a given listener
|
||||
bool Remove(CObject* listener)
|
||||
{
|
||||
bool removed = false;
|
||||
for (int i = 0; i < MAXCOUNT; i++)
|
||||
{
|
||||
if (m_params[i].m_receipt &&
|
||||
m_params[i].m_listener == listener)
|
||||
{
|
||||
m_params[i].m_receipt = 0;
|
||||
m_params[i].m_cb = 0;
|
||||
m_params[i].m_listener = 0;
|
||||
removed = true;
|
||||
}
|
||||
}
|
||||
return removed;
|
||||
}
|
||||
|
||||
// Input: caller - Caller to notify listeners.
|
||||
// Summary: Notifies listeners
|
||||
void Notify(T caller)
|
||||
{
|
||||
for (int i = 0; i < MAXCOUNT; i++)
|
||||
{
|
||||
if (m_params[i].m_receipt)
|
||||
{
|
||||
(m_params[i].m_listener->*m_params[i].m_cb)(caller);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#endif // !defined(__XTCALLBACKS_H__)
|
||||
222
Editor/XT/Include/XTCaption.h
Normal file
222
Editor/XT/Include/XTCaption.h
Normal file
@@ -0,0 +1,222 @@
|
||||
// XTCaption.h : interface for the CXTCaption class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTCAPTION_H__)
|
||||
#define __XTCAPTION_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTCaptionButton is a CXTButton derived class. It is used by
|
||||
// the CXTCaption class to activate a CXTCaptionPopupWnd window.
|
||||
class _XT_EXT_CLASS CXTCaptionButton : public CXTButton
|
||||
{
|
||||
public:
|
||||
|
||||
// Input: clrFace - An RGB value that represents the button background color.
|
||||
// clrText - An RGB value that represents the font color.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will set the style for the caption button.
|
||||
virtual BOOL SetButtonStyle(COLORREF clrFace, COLORREF clrText);
|
||||
|
||||
protected:
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// nState - A UINT value that represents the current state for the button.
|
||||
// rcItem - A CRect reference that represents the current size for the button.
|
||||
// Summary: This member function will draw the text for the button, if any.
|
||||
virtual void DrawButtonText(CDC* pDC, UINT nState, CRect& rcItem);
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// nState - A UINT value that represents the current state for the button.
|
||||
// rcItem - A CRect reference that represents the current size for the button.
|
||||
// Summary: This member function draws the icon for the button, if any.
|
||||
virtual void DrawButtonIcon(CDC* pDC, UINT nState, CRect& rcItem);
|
||||
};
|
||||
|
||||
class CXTCaptionPopupWnd;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTCaption is a CStatic derived class. It is used to create caption
|
||||
// or info bars similar to those in Microsoft® Outlook™.
|
||||
class _XT_EXT_CLASS CXTCaption : public CStatic
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTCaption)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTCaption object.
|
||||
CXTCaption();
|
||||
|
||||
// Summary: Destroys a CXTCaption object, handles cleanup and de-allocation.
|
||||
virtual ~CXTCaption();
|
||||
|
||||
protected:
|
||||
|
||||
int m_nOffset; // Size, in pixels, that the child window should leave for its caption area.
|
||||
int m_nBorder; // Size, in pixels, for the caption border.
|
||||
bool m_bUserColors; // true if the user has specified caption colors other than the default.
|
||||
CWnd* m_pChildWnd; // A CWnd pointer that represents the child window displayed in the popup window.
|
||||
CWnd* m_pParentView; // A CWnd pointer that represents the child window's parent view.
|
||||
CWnd* m_pSplitterWnd; // A CWnd pointer that represents the splitter window. It is used to track size changes.
|
||||
CSize m_sizeIcon; // Width and height of the caption icon area.
|
||||
CRect m_rcChild; // Size of the child window displayed in the popup.
|
||||
CRect m_rcParent; // Size of the child's parent view.
|
||||
CRect m_rcSplitter; // Size of the splitter window.
|
||||
DWORD m_dwExStyle; // Border style bits, either CPWS_EX_GROOVE_EDGE | CPWS_EX_RAISED_EDGE.
|
||||
DWORD m_dwTextStyle; // Text style, one of DT_ styles. See CDC::DrawText(...) for more details.
|
||||
HICON m_hIcon; // User defined icon handle. The default value is NULL.
|
||||
CString m_strCaption; // Text that will be displayed in the caption.
|
||||
COLORREF m_clrBorder; // An RGB value that represents the user defined border color.
|
||||
COLORREF m_clrFace; // An RGB value that represents the user defined background color.
|
||||
COLORREF m_clrText; // An RGB value that represents the user defined font color.
|
||||
CImageList m_ilButton; // Image list used to create the close button icon.
|
||||
CXTCaptionButton m_btnCaption; // Button used to 'tack' the popup window back in place.
|
||||
CXTCaptionPopupWnd* m_pPopupWnd; // Points to the popup window.
|
||||
|
||||
public:
|
||||
|
||||
// Returns: A reference to a CXTCaptionButton object.
|
||||
// Summary: Call this member function to get a reference to the caption's close
|
||||
// / popup button.
|
||||
CXTCaptionButton& GetCaptionButton();
|
||||
|
||||
// Input: clrBorder - An RGB value that represents the new border color.
|
||||
// clrFace - An RGB value that represents the new background color.
|
||||
// clrText - An RGB value that represents the new font color.
|
||||
// Summary: This member function will set the caption bar border, background,
|
||||
// and font colors.
|
||||
virtual void SetCaptionColors(COLORREF clrBorder, COLORREF clrFace, COLORREF clrText);
|
||||
|
||||
// Input: nBorderSize - Specifies size, in pixels, of the banner border.
|
||||
// pFont - Specifies the new caption font.
|
||||
// lpszWindText - NULL terminated string specifying the new caption text.
|
||||
// hIcon - Handle of the icon to be drawn in the caption.
|
||||
// Summary: This function will modify the caption style. You can use this
|
||||
// member function to set the border size that is drawn around the
|
||||
// caption banner, the font that the caption will use, and the caption text
|
||||
// and icon to be displayed.
|
||||
virtual void ModifyCaptionStyle(int nBorderSize, CFont* pFont=NULL, LPCTSTR lpszWindText=NULL, HICON hIcon=NULL);
|
||||
|
||||
// Input: pChild - A CWnd pointer that represents the child window to be displayed in
|
||||
// the popup window.
|
||||
// pNotifyWnd - A CWnd pointer that represents the window to receive notification
|
||||
// messages.
|
||||
// Summary: Call this member function to set the child and notification windows
|
||||
// for the caption bar.
|
||||
virtual void SetChildWindow(CWnd* pChild, CWnd* pNotifyWnd);
|
||||
|
||||
// Summary: This member function is called to destroy the popup window and associated
|
||||
// children.
|
||||
virtual void KillChildWindow();
|
||||
|
||||
// Input: lpszWindowText - NULL terminated string to display in the caption bar.
|
||||
// hIcon - Handle of the icon to display in the caption bar. It can be NULL.
|
||||
// Summary: This member function is called to update the text and icon for the
|
||||
// caption bar.
|
||||
virtual void UpdateCaption(LPCTSTR lpszWindowText, HICON hIcon);
|
||||
|
||||
// Input: dwStyle - Specifies the method of formatting the text. See CDC::DrawText
|
||||
// for a detailed listing of available styles.
|
||||
// Summary: This member function is called to set the formatting style of the
|
||||
// text that is displayed in the caption bar.
|
||||
virtual void SetTextStyle(DWORD dwStyle);
|
||||
|
||||
// Returns: A DWORD value that represents the formatting style of the current caption text.
|
||||
// Summary: This member function is called to retrieve the formatting style of
|
||||
// the text that is displayed in the caption bar.
|
||||
virtual DWORD GetTextStyle();
|
||||
|
||||
// Input: pParentWnd - Specifies the parent window.
|
||||
// lpszWindowName - Points to a null-terminated character string that contains
|
||||
// the window name. This will be displayed in the caption area.
|
||||
// dwExStyle - Specifies caption bar style. Can be either CPWS_EX_RAISED_EDGE
|
||||
// which will draw a 3D edge around the caption bar, or CPWS_EX_GROOVE_EDGE
|
||||
// which will draw a sunken edge.
|
||||
// dwStyle - Specifies the control window style. Apply any combination of
|
||||
// caption bar styles to the control.
|
||||
// rect - Specifies the position and size of the caption bar. It can be
|
||||
// either a RECT structure or a CRect object.
|
||||
// nID - Specifies the caption bar control ID.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This method creates a caption bar window and attaches it to the
|
||||
// CXTCaption object. You construct a caption bar in two steps. First,
|
||||
// call the constructor, which constructs the CXTCaption object. Then
|
||||
// call Create, which creates the Window's child window and attaches it
|
||||
// to CXTCaption. Create initializes the window class name and window
|
||||
// name and registers values for its style, parent, and ID.
|
||||
virtual BOOL Create(CWnd* pParentWnd, LPCTSTR lpszWindowName, DWORD dwExStyle=CPWS_EX_RAISED_EDGE, DWORD dwStyle=WS_VISIBLE|SS_CENTER|SS_CENTERIMAGE, const CRect& rect=CRect(0,0,0,0), UINT nID = 0xffff);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTCaption)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// rcItem - A CRect reference that represents the size of the area to paint.
|
||||
// Summary: This member function is called to draw the caption background.
|
||||
virtual void DrawCaptionBack(CDC* pDC, CRect& rcItem);
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// rcItem - A CRect reference that represents the size of the area to paint.
|
||||
// Summary: This member function is called to paint the caption text.
|
||||
virtual void DrawCaptionText(CDC* pDC, CRect& rcItem);
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// rcItem - A CRect reference that represents the size of the area to paint.
|
||||
// Summary: This member function is called to paint the caption icon.
|
||||
virtual void DrawCaptionIcon(CDC* pDC, CRect& rcItem);
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// rcItem - A CRect reference that represents the size of the area to paint.
|
||||
// Summary: This member function is called to update the caption text.
|
||||
virtual void UpdateCaptionText(CDC* pDC, CRect& rcItem);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTCaption)
|
||||
afx_msg void OnPaint();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
|
||||
afx_msg void OnSysColorChange();
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg void OnCaptButton();
|
||||
afx_msg void OnPushPinButton();
|
||||
afx_msg void OnPushPinCancel();
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
friend class CXTCaptionButton;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTCaption::SetTextStyle(DWORD dwStyle) {
|
||||
m_dwTextStyle = dwStyle;
|
||||
}
|
||||
AFX_INLINE DWORD CXTCaption::GetTextStyle() {
|
||||
return m_dwTextStyle;
|
||||
}
|
||||
AFX_INLINE CXTCaptionButton& CXTCaption::GetCaptionButton() {
|
||||
ASSERT(::IsWindow(m_btnCaption.m_hWnd)); return m_btnCaption;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTCAPTION_H__)
|
||||
79
Editor/XT/Include/XTCaptionPopupWnd.h
Normal file
79
Editor/XT/Include/XTCaptionPopupWnd.h
Normal file
@@ -0,0 +1,79 @@
|
||||
// XTCaptionPopupWnd.h : interface for the CXTCaptionPopupWnd class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTCAPTIONPOPUPWND_H__)
|
||||
#define __XTCAPTIONPOPUPWND_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTCaptionPopupWnd is a CWnd derived class. It is used by the CXTCaption
|
||||
// class to display a popup child window similar to Outlook™.
|
||||
class _XT_EXT_CLASS CXTCaptionPopupWnd : public CWnd
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTCaptionPopupWnd)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTCaptionPopupWnd object.
|
||||
CXTCaptionPopupWnd();
|
||||
|
||||
// Summary: Destroys a CXTCaptionPopupWnd object, handles cleanup and de-allocation.
|
||||
virtual ~CXTCaptionPopupWnd();
|
||||
|
||||
protected:
|
||||
|
||||
CWnd* m_pParentWnd; // A CWnd pointer that represents the parent window.
|
||||
CWnd* m_pChildWnd; // A CWnd pointer that represents the child displayed in the popup.
|
||||
CWnd* m_pChildParent; // A CWnd pointer that represents the parent of the child window.
|
||||
CXTButton m_CaptionButton; // Close button associated with the caption.
|
||||
CXTCaption m_Caption; // Caption that is displayed when the window is active.
|
||||
CXTIconHandle m_hIconOn; // Handle to a normal button icon.
|
||||
CXTIconHandle m_hIconOff; // Handle to a pressed button icon.
|
||||
|
||||
public:
|
||||
|
||||
// Input: rect - A CRect reference that represents the size of the popup window.
|
||||
// pParentWnd - A CWnd pointer that represents the popup window.
|
||||
// pChildWnd - A CWnd pointer that represents the child to be displayed when
|
||||
// the window is activated.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function is called to create and display the popup
|
||||
// window.
|
||||
virtual BOOL Create(const CRect& rect, CWnd* pParentWnd, CWnd* pChildWnd);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTCaptionPopupWnd)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTCaptionPopupWnd)
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnCaptButton();
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnTimer(UINT_PTR nIDEvent);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTCAPTIONPOPUPWND_H__)
|
||||
213
Editor/XT/Include/XTCheckListBox.h
Normal file
213
Editor/XT/Include/XTCheckListBox.h
Normal file
@@ -0,0 +1,213 @@
|
||||
// XTCheckListBox.h : interface for the CXTCheckListBox class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTCHECKLISTBOX_H__)
|
||||
#define __XTCHECKLISTBOX_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
// CXTCheckListState - helper class
|
||||
|
||||
class _XT_EXT_CLASS CXTCheckListState : public CNoTrackObject
|
||||
{
|
||||
public:
|
||||
CXTCheckListState(UINT uBitmapID);
|
||||
virtual ~CXTCheckListState();
|
||||
HBITMAP m_hbitmapCheck;
|
||||
CSize m_sizeCheck;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: The CXTCheckListBox class is a CXTListBox derived class. It provides
|
||||
// the functionality of a Windows checklist box. A <20>checklist box<6F> displays
|
||||
// a list of items, such as filenames. Each item in the list has a check
|
||||
// box next to it that the user can check or clear.
|
||||
//
|
||||
// CXTCheckListBox is only for owner-drawn controls because the list contains
|
||||
// more than text strings. At its simplest, a checklist box contains text
|
||||
// strings and check boxes, but you do not need to have text at all. For
|
||||
// example, you could have a list of small bitmaps with a check box next
|
||||
// to each item.
|
||||
//
|
||||
// To create your own checklist box, you must derive your own class from
|
||||
// CXTCheckListBox. To derive your own class, write a constructor for
|
||||
// the derived class, then call Create.
|
||||
//
|
||||
// If your checklist box is a default checklist box (a list of strings
|
||||
// with the default-sized checkboxes to the left of each), you can use
|
||||
// the default CXTCheckListBox::DrawItem to draw the checklist box. Otherwise,
|
||||
// you must override the CListBox::CompareItem function and the
|
||||
// CXTCheckListBox::DrawItem and CXTCheckListBox::MeasureItem functions.
|
||||
class _XT_EXT_CLASS CXTCheckListBox : public CXTListBox
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTCheckListBox)
|
||||
|
||||
public:
|
||||
|
||||
// Input: uBitmapID - Resource identifier of the bitmap to use for checkmarks.
|
||||
// Summary: Constructs a CXTCheckListBox object.
|
||||
CXTCheckListBox(UINT uBitmapID=XT_IDB_CHECKLISTBOX);
|
||||
|
||||
// Summary: Destroys a CXTCheckListBox object, handles cleanup and de-allocation.
|
||||
virtual ~CXTCheckListBox();
|
||||
|
||||
protected:
|
||||
|
||||
int m_cyText;
|
||||
UINT m_nStyle;
|
||||
CXTCheckListState m_checkListState;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
// Input: dwStyle - Specifies the style of the checklist box. The style must be
|
||||
// either LBS_OWNERDRAWFIXED (all items in the list are the same height)
|
||||
// or LBS_OWNERDRAWVARIABLE (items in the list are of varying heights).
|
||||
// This style can be combined with other list-box styles.
|
||||
// rect - Specifies the checklist-box size and position. Can be either a
|
||||
// CRect object or a RECT structure.
|
||||
// pParentWnd - Specifies the checklist box<6F>s parent window (usually a
|
||||
// CDialog object). It must not be NULL.
|
||||
// nID - Specifies the checklist box<6F>s control ID.
|
||||
// Returns: Nonzero if successful; otherwise 0.
|
||||
// Summary: Creates the Windows checklist box and attaches it to the CXTListBox object.
|
||||
virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: nStyle - Determines the style of check boxes in the checklist box. Valid styles are:
|
||||
// [ul]
|
||||
// [li]<b>BS_CHECKBOX</b>[/li]
|
||||
// [li]<b>BS_AUTOCHECKBOX</b>[/li]
|
||||
// [li]<b>BS_AUTO3STATE</b>[/li]
|
||||
// [li]<b>BS_3STATE</b>[/li]
|
||||
// [/ul]
|
||||
// For information on these styles, see Button Styles.
|
||||
// Summary: Call this function to set the style of check boxes in the checklist box.
|
||||
void SetCheckStyle(UINT nStyle);
|
||||
|
||||
// Returns: The style of the control<6F>s check boxes.
|
||||
// Summary: Call this function to get the checklist box<6F>s style. For information on
|
||||
// possible styles, see SetCheckStyle.
|
||||
// See Also: SetCheckStyle
|
||||
UINT GetCheckStyle();
|
||||
|
||||
// Input: nIndex - Index of the item whose check box is to be set.
|
||||
// nCheck - State of the check box: 0 for clear, 1 for checked, and 2 for
|
||||
// indeterminate.
|
||||
// Summary: Call this function to set the check box of the item specified by nIndex.
|
||||
void SetCheck(int nIndex, int nCheck);
|
||||
|
||||
// Input: nIndex - Index of the item whose check status is to be retrieved.
|
||||
// Returns: Zero if the item is not checked, 1 if it is checked, and 2 if it is
|
||||
// indeterminate.
|
||||
// Summary: Call this function to determine the check state of an item.
|
||||
int GetCheck(int nIndex);
|
||||
|
||||
// Input: nIndex - Index of the checklist box item to be enabled.
|
||||
// bEnabled - Specifies whether the item is enabled or disabled.
|
||||
// Summary: Call this function to enable or disable a checklist box item.
|
||||
void Enable(int nIndex, BOOL = TRUE);
|
||||
|
||||
// Input: nIndex - Index of the item.
|
||||
// Returns: Nonzero if the item is enabled; otherwise 0.
|
||||
// Summary: Call this function to determine whether an item is enabled.
|
||||
BOOL IsEnabled(int nIndex);
|
||||
|
||||
// Input: rectItem - The position and size of the list item.
|
||||
// rectCheckBox - The default position and size of an item's check box.
|
||||
// Example: The following function overrides the default and puts the check box on the
|
||||
// right of the item, makes it the same height as the item (minus a pixel
|
||||
// offset at the top and bottom), and makes it the standard check box width:
|
||||
// <pre>
|
||||
// CRect CMyCheckListBox::OnGetCheckPosition(CRect rectItem, CRect rectCheckBox)
|
||||
// {
|
||||
// CRect rectMyCheckBox;
|
||||
// rectMyCheckBox.top = rectItem.top -1;
|
||||
// rectMyCheckBox.bottom = rectItem.bottom -1;
|
||||
// rectMyCheckBox.right = rectItem.right -1;
|
||||
// rectMyCheckBox.left = rectItem.right -1 - rectCheckBox.Width();
|
||||
// return rectMyCheckBox;
|
||||
// }
|
||||
// </pre>
|
||||
// Returns: The position and size of an item's check box.
|
||||
// Summary: The framework calls this function to get the position and size of the
|
||||
// check box in an item.
|
||||
//
|
||||
// The default implementation only returns the default position and size
|
||||
// of the check box (rectCheckBox). By default, a check box is aligned in
|
||||
// the upper-left corner of an item and is the standard check box size. There
|
||||
// may be cases where you want the check boxes on the right, or want a larger
|
||||
// or smaller check box. In these cases, override OnGetCheckPosition to change
|
||||
// the check box position and size within the item.
|
||||
virtual CRect OnGetCheckPosition(CRect rectItem, CRect rectCheckBox);
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTCheckListBox)
|
||||
public:
|
||||
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
|
||||
virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
|
||||
virtual BOOL OnChildNotify(UINT, WPARAM, LPARAM, LRESULT*);
|
||||
virtual void PreSubclassWindow();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual int GetFontHeight();
|
||||
virtual int PreCompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct);
|
||||
virtual int CalcMinimumItemHeight();
|
||||
virtual int CheckFromPoint(CPoint point, BOOL& bInCheck);
|
||||
virtual void PreDrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
|
||||
virtual void PreMeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
|
||||
virtual void PreDeleteItem(LPDELETEITEMSTRUCT lpDeleteItemStruct);
|
||||
virtual void SetSelectionCheck( int nCheck );
|
||||
virtual void InvalidateCheck(int nIndex);
|
||||
virtual void InvalidateItem(int nIndex);
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTCheckListBox)
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
|
||||
afx_msg LRESULT OnSetFont(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnLBAddString(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnLBFindString(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnLBFindStringExact(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnLBGetItemData(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnLBGetText(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnLBInsertString(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnLBSelectString(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnLBSetItemData(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnLBSetItemHeight(WPARAM wParam, LPARAM lParam);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE UINT CXTCheckListBox::GetCheckStyle() {
|
||||
return m_nStyle;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTCHECKLISTBOX_H__)
|
||||
129
Editor/XT/Include/XTColorDialog.h
Normal file
129
Editor/XT/Include/XTColorDialog.h
Normal file
@@ -0,0 +1,129 @@
|
||||
// XTColorDialog.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTCOLORSHEET_H__)
|
||||
#define __XTCOLORSHEET_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTColorDialog is a multiple inheritance class derived from CXTDialogState
|
||||
// and CPropertySheet. It is an Office™ style color dialog and can be used
|
||||
// as a drop in replacement for the MFC CColorDialog API.
|
||||
class _XT_EXT_CLASS CXTColorDialog : CXTDialogState, public CPropertySheet
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTColorDialog)
|
||||
|
||||
public:
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: clrNew - An RGB value that represents the new color selection.
|
||||
// clrCurrent - An RGB value that represents the default color selection.
|
||||
// dwFlags - Style for color dialog. It can be one of the following:
|
||||
// [ul]
|
||||
// [li]<b>CPS_XT_SHOW3DSELECTION</b> Displays the color selection
|
||||
// box with a 3D raised border.[/li]
|
||||
// [li]<b>CPS_XT_SHOWHEXVALUE</b> Displays the hex equivalent of
|
||||
// the selected color.[/li]
|
||||
// [/ul]
|
||||
// pWndParent - A pointer to the dialog box<6F>s parent or owner window.
|
||||
// Summary: Constructs a CXTColorDialog object.
|
||||
CXTColorDialog(COLORREF clrNew,COLORREF clrCurrent,DWORD dwFlags = 0L,CWnd* pWndParent = NULL);
|
||||
|
||||
// Summary: Destroys a CXTColorDialog object, handles cleanup and de-allocation.
|
||||
virtual ~CXTColorDialog();
|
||||
|
||||
protected:
|
||||
|
||||
DWORD m_dwStyle; // Styles for the dialog.
|
||||
CEdit m_editHex; // Edit window to display the color hex value.
|
||||
CRect m_rcNew; // Size of the rectangle that represents the new color.
|
||||
CRect m_rcCurrent; // Size of the rectangle that represents the current color.
|
||||
COLORREF m_clrNew; // A COLORREF value that contains the RGB information for the new color.
|
||||
COLORREF m_clrCurrent; // A COLORREF value that contains the RGB information for the current color.
|
||||
|
||||
public:
|
||||
|
||||
// Input: clr - An RGB value that represents the color.
|
||||
// bNotify - TRUE to notify tab pages of a color change.
|
||||
// Summary: Call this member function to set the current color selection to the
|
||||
// color value specified in 'clr'. The dialog box will automatically update
|
||||
// the user<65>s selection based on the value of the 'clr' parameter.
|
||||
void SetNewColor(COLORREF clr, BOOL bNotify=TRUE);
|
||||
|
||||
// Input: clr - An RGB value that represents the color.
|
||||
// Summary: Call this function to set the new color selection to the color
|
||||
// value specified in 'clr'.
|
||||
void SetCurrentColor(COLORREF clr);
|
||||
|
||||
// Returns: A COLORREF value that contains the RGB information for
|
||||
// the current color specified when the dialog was instantiated.
|
||||
// Summary: Call this member function to retrieve the information about the current
|
||||
// color.
|
||||
COLORREF GetCurrentColor();
|
||||
|
||||
// Returns: A COLORREF value that contains the RGB information
|
||||
// for the new color selected in the color dialog box.
|
||||
// Summary: Call this member function to retrieve the information about the color
|
||||
// the user selected.
|
||||
COLORREF GetColor();
|
||||
|
||||
// Input: strText - A NULL terminated string.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to copy the string specified by 'strText' to the
|
||||
// Windows clipboard.
|
||||
BOOL CopyToClipboard(CString strText);
|
||||
|
||||
// Input: clr - An RGB value that represents the color.
|
||||
// Returns: A CString object.
|
||||
// Summary: This member function returns a CString object that represents the
|
||||
// HEX conversion for the specified RGB color.
|
||||
CString RGBtoHex(COLORREF clr) const;
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTColorDialog)
|
||||
public:
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTColorDialog)
|
||||
afx_msg void OnPaint();
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE COLORREF CXTColorDialog::GetCurrentColor() {
|
||||
return m_clrCurrent;
|
||||
}
|
||||
AFX_INLINE COLORREF CXTColorDialog::GetColor() {
|
||||
return m_clrNew;
|
||||
}
|
||||
|
||||
#define WM_XT_UPDATECOLOR (WM_USER+1024)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(__XTCOLORSHEET_H__)
|
||||
338
Editor/XT/Include/XTColorPageCustom.h
Normal file
338
Editor/XT/Include/XTColorPageCustom.h
Normal file
@@ -0,0 +1,338 @@
|
||||
// XTColorPageCustom.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTCOLORCUSTOM_H__)
|
||||
#define __XTCOLORCUSTOM_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_HAS_FOCUS is an enumeration used by CXTColorBase for determining
|
||||
// which color window has focus.
|
||||
typedef enum XT_HAS_FOCUS
|
||||
{
|
||||
none, // Neither color window has focus.
|
||||
wnd, // Color wheel window has focus.
|
||||
lum // Lumination window has focus.
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTColorBase is a CStatic derived base class. It is used to create
|
||||
// custom color selection windows.
|
||||
class _XT_EXT_CLASS CXTColorBase : public CStatic
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTColorBase object.
|
||||
CXTColorBase();
|
||||
|
||||
// Summary: Destroys a CXTColorBase object, handles cleanup and de-allocation.
|
||||
virtual ~CXTColorBase();
|
||||
|
||||
protected:
|
||||
|
||||
CDC m_dcPicker; // Background device context.
|
||||
COLORREF m_clrColor; // An RGB value that represents the color selection.
|
||||
static XT_HAS_FOCUS m_eHasFocus; // Determines which color has focus.
|
||||
|
||||
protected:
|
||||
|
||||
bool m_bInitControl; // true for initialization.
|
||||
|
||||
public:
|
||||
|
||||
double m_nLum; // Current lumination value.
|
||||
double m_nSat; // Current saturation value.
|
||||
double m_nHue; // Current hue value.
|
||||
CPoint m_ptMousePos; // Current mouse postion relative to the device context.
|
||||
|
||||
// Input: clr - An RGB value that represents the color.
|
||||
// bUpdate - true to update the cursor position.
|
||||
// Summary: Call this member function to set the color for the selection window.
|
||||
virtual void SetColor(COLORREF clr, bool bUpdate=true);
|
||||
|
||||
// Returns: An RGB value that indicates the color selection.
|
||||
// Summary: Call this member function to return the current color selection.
|
||||
virtual COLORREF GetColor();
|
||||
|
||||
// Input: point - Current cursor location relative to the device context.
|
||||
// bNotify - TRUE to notify the parent of change.
|
||||
// Summary: Call this member function to update the cursor position.
|
||||
virtual void UpdateCursorPos(CPoint point, BOOL bNotify=TRUE);
|
||||
|
||||
// Input: color - An RGB value that represents the value to convert to HSL.
|
||||
// h - Represents the color hue.
|
||||
// s - Represents the color saturation.
|
||||
// l - Represents the color lumination.
|
||||
// Summary: This member function is called to convert an RGB color value to
|
||||
// an HSL value.
|
||||
static void RGBtoHSL(COLORREF color, double *h, double *s, double *l );
|
||||
|
||||
// Input: h - Represents the color hue.
|
||||
// l - Represents the color lumination.
|
||||
// s - Represents the color saturation.
|
||||
// Returns: A COLORREF value.
|
||||
// Summary: This member function is called to convert an HLS value to an RGB
|
||||
// color value.
|
||||
static COLORREF HLStoRGB(double h, double l, double s );
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTColorBase)
|
||||
protected:
|
||||
virtual void PreSubclassWindow();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTColorBase)
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE COLORREF CXTColorBase::GetColor() {
|
||||
return m_clrColor;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTColorWnd is a CXTColorBase derived class. It is used to create a
|
||||
// color selection window.
|
||||
class _XT_EXT_CLASS CXTColorWnd : public CXTColorBase
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTColorWnd object.
|
||||
CXTColorWnd();
|
||||
|
||||
// Summary: Destroys a CXTColorWnd object, handles cleanup and de-allocation.
|
||||
virtual ~CXTColorWnd();
|
||||
|
||||
public:
|
||||
|
||||
// Input: clr - An RGB value that represents the color.
|
||||
// bUpdate - true to update cursor position.
|
||||
// Summary: Call this member function to set the color for the selection window.
|
||||
virtual void SetColor(COLORREF clr, bool bUpdate=true);
|
||||
|
||||
// Input: point - Current cursor location relative to the device context.
|
||||
// bNotify - TRUE to notify the parent of change.
|
||||
// Summary: Call this member function to update the cursor position.
|
||||
virtual void UpdateCursorPos(CPoint point, BOOL bNotify=TRUE);
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// Summary: This member function is called to update the cross hair cursor.
|
||||
void DrawCrossHair(CDC* pDC);
|
||||
|
||||
// Input: h - Represents the new hue value to set.
|
||||
// Summary: This member function is called to set the hue for the color window.
|
||||
void SetHue(double h);
|
||||
|
||||
// Input: s - Represents the new saturation value to set.
|
||||
// Summary: This member function is called to set the saturation for the color
|
||||
// window.
|
||||
void SetSaturation(double s);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTColorWnd)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTColorWnd)
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnSetFocus(CWnd* pOldWnd);
|
||||
afx_msg void OnKillFocus(CWnd* pNewWnd);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTColorLum is a CXTColorBase derived class. It is used to create a
|
||||
// color luminance selection bar.
|
||||
class _XT_EXT_CLASS CXTColorLum : public CXTColorBase
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTColorLum object.
|
||||
CXTColorLum();
|
||||
|
||||
// Summary: Destroys a CXTColorLum object, handles cleanup and de-allocation.
|
||||
virtual ~CXTColorLum();
|
||||
|
||||
protected:
|
||||
|
||||
int m_nSliderPos; // Current location of the slider.
|
||||
|
||||
public:
|
||||
|
||||
// Input: clr - An RGB value that represents the color.
|
||||
// bUpdate - true to update the cursor position.
|
||||
// Summary: Call this member function to set the color for the selection window.
|
||||
virtual void SetColor(COLORREF clr, bool bUpdate=true);
|
||||
|
||||
// Input: point - Current cursor location relative to the device context.
|
||||
// bNotify - TRUE to notify the parent of change.
|
||||
// Summary: Call this member function to update the cursor position.
|
||||
virtual void UpdateCursorPos(CPoint point, BOOL bNotify=TRUE);
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// Summary: This member function is called to draw the indicator arrow.
|
||||
void DrawSliderArrow(CDC* pDC);
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// Summary: This member function is called to draw the selection bar.
|
||||
void DrawLuminanceBar(CDC* pDC);
|
||||
|
||||
// Input: l - Represents the new luminance value to set.
|
||||
// Summary: This member function is called to set the luminance for the color window.
|
||||
void SetLuminance(double l);
|
||||
|
||||
// Input: rect - Address to a CRect object.
|
||||
// Summary: This member function is called to get the display size of the luminance
|
||||
// bar.
|
||||
void GetLumBarRect(CRect& rect);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTColorLum)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTColorLum)
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnSetFocus(CWnd* pOldWnd);
|
||||
afx_msg void OnKillFocus(CWnd* pNewWnd);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
// forwards
|
||||
|
||||
class CXTColorDialog;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTColorPageCustom is a multiple inheritance class derived from CXTDialogState
|
||||
// and CPropertyPage. It is used to create a CXTColorPageCustom dialog.
|
||||
class _XT_EXT_CLASS CXTColorPageCustom : CXTDialogState, public CPropertyPage
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTColorPageCustom)
|
||||
|
||||
public:
|
||||
|
||||
// Input: pParentSheet - A pointer to the parent sheet.
|
||||
// Summary: Constructs a CXTColorPageCustom object.
|
||||
CXTColorPageCustom(CXTColorDialog* pParentSheet=NULL);
|
||||
|
||||
// Summary: Destroys a CXTColorPageCustom object, handles cleanup and de-allocation.
|
||||
virtual ~CXTColorPageCustom();
|
||||
|
||||
//{{AFX_DATA(CXTColorPageCustom)
|
||||
|
||||
enum { IDD = XT_IDD_COLORCUSTOM };
|
||||
CXTColorWnd m_colorWnd;
|
||||
CXTColorLum m_colorLum;
|
||||
CStatic m_txtSat;
|
||||
CStatic m_txtRed;
|
||||
CStatic m_txtLum;
|
||||
CStatic m_txtHue;
|
||||
CStatic m_txtGreen;
|
||||
CStatic m_txtBlue;
|
||||
CSpinButtonCtrl m_spinSat;
|
||||
CSpinButtonCtrl m_spinRed;
|
||||
CSpinButtonCtrl m_spinLum;
|
||||
CSpinButtonCtrl m_spinHue;
|
||||
CSpinButtonCtrl m_spinGreen;
|
||||
CSpinButtonCtrl m_spinBlue;
|
||||
CXTEdit m_editHue;
|
||||
CXTEdit m_editGreen;
|
||||
CXTEdit m_editBlue;
|
||||
CXTEdit m_editLum;
|
||||
CXTEdit m_editRed;
|
||||
CXTEdit m_editSat;
|
||||
int m_nR;
|
||||
int m_nB;
|
||||
int m_nG;
|
||||
int m_nH;
|
||||
int m_nL;
|
||||
int m_nS;
|
||||
//}}AFX_DATA
|
||||
|
||||
protected:
|
||||
|
||||
CXTColorDialog* m_pParentSheet; // A pointer to the parent sheet.
|
||||
|
||||
public:
|
||||
|
||||
// Input: color - An RGB value that represents the color.
|
||||
// lum - Address of the integer to receive the lumination value (0-255).
|
||||
// sat - Address of the integer to receive the saturation value (0-255).
|
||||
// hue - Address of the integer to receive the hue value (0-255).
|
||||
// Summary: This member function is called to retrieve the HSL values of the RGB
|
||||
// specified by color.
|
||||
void RGBtoHSL(COLORREF color, int* lum, int* sat, int* hue);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTColorPageCustom)
|
||||
public:
|
||||
virtual BOOL OnSetActive();
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX);
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTColorPageCustom)
|
||||
afx_msg void OnChangeEdit();
|
||||
afx_msg void OnChangeEditLum();
|
||||
afx_msg void OnChangeEditHue();
|
||||
afx_msg void OnChangeEditSat();
|
||||
afx_msg void OnPaint();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnUpdateColor(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(__XTCOLORCUSTOM_H__)
|
||||
224
Editor/XT/Include/XTColorPageStandard.h
Normal file
224
Editor/XT/Include/XTColorPageStandard.h
Normal file
@@ -0,0 +1,224 @@
|
||||
// XTColorPageStandard.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTCOLORSTANDARD_H__)
|
||||
#define __XTCOLORSTANDARD_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_COLORCELL is a stand alone helper structure class. It is used by
|
||||
// the CXTColorHex class.
|
||||
struct XT_COLORCELL
|
||||
{
|
||||
int direction[4]; // Array that indicates which cell index is to the left, top, right and bottom of the color cell.
|
||||
BOOL bSmall; // TRUE if the color cell is a standard selection rectangle.
|
||||
CPoint* pPoint; // Represents the current cursor position.
|
||||
COLORREF clr; // An RGB value.
|
||||
};
|
||||
|
||||
// Summary: Definition for the color cell array.
|
||||
typedef CList<XT_COLORCELL*,XT_COLORCELL*> CCXTColorCell;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTColorHex is a CStatic derived class. It displays a color selection
|
||||
// grid used by CXTColorPageStandard.
|
||||
class _XT_EXT_CLASS CXTColorHex : public CStatic
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTColorHex object.
|
||||
CXTColorHex();
|
||||
|
||||
// Summary: Destroys a CXTColorHex object, handles cleanup and de-allocation.
|
||||
virtual ~CXTColorHex();
|
||||
|
||||
protected:
|
||||
|
||||
CDC m_dcPicker; // Background device context.
|
||||
bool m_bInitControl; // true for initialization.
|
||||
BOOL m_bLBtnDown; // TRUE when the left mouse button is pressed.
|
||||
BOOL m_bSmallCell; // TRUE when a small color cell is selected.
|
||||
CPoint m_ptCurrent; // Holds the last known selection point.
|
||||
COLORREF m_clrColor; // A COLORREF value that contains the RGB information for the current color.
|
||||
CCXTColorCell m_arCells; // Array of XT_COLORCELL structs that represent displayed color cells.
|
||||
|
||||
public:
|
||||
|
||||
// Input: point - XY location of the color to get RGB information for.
|
||||
// Summary: Call this member function to retrieve RGB information for the color
|
||||
// found at the location specified by point. Returns a COLORREF value.
|
||||
COLORREF ColorFromPoint(CPoint point);
|
||||
|
||||
// Input: clr - An RGB value that represents the color.
|
||||
// Returns: A pointer to an XT_COLORCELL struct.
|
||||
// Summary: Call this member function to get a pointer to the XT_COLORCELL struct
|
||||
// that is represented by 'clr'.
|
||||
XT_COLORCELL* GetColorCell(COLORREF clr);
|
||||
|
||||
// Input: iIndex - Index into m_arCells list.
|
||||
// Summary: Call this member function to select the color specified by 'iIndex'.
|
||||
void SetSelectedColor(int iIndex);
|
||||
|
||||
// Input: clr - An RGB value that represents the color.
|
||||
// Summary: Call this member function to select the color specified by 'clr'.
|
||||
void SetSelectedColor(COLORREF clr);
|
||||
|
||||
// Returns: An RGB color value that represents the selected color.
|
||||
// Summary: Call this member function to return the currently selected color.
|
||||
COLORREF GetSelectedColor() const;
|
||||
|
||||
protected:
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// point - XY position of the starting point for the first pixel drawn.
|
||||
// clr - An RGB value that represents the color of the cell to draw.
|
||||
// l - Index of the cell to be selected when VK_LEFT is pressed.
|
||||
// u - Index of the cell to be selected when VK_UP is pressed.
|
||||
// r - Index of the cell to be selected when VK_RIGHT is pressed.
|
||||
// d - Index of the cell to be selected when VK_DOWN is pressed.
|
||||
// Summary: This member function is called by the class to draw a single color cell.
|
||||
void DrawCell(CDC* pDC, CPoint point, COLORREF clr, int l, int u, int r, int d);
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// point - XY position of the starting point for the first pixel drawn.
|
||||
// clr - An RGB value that represents the color of the cell to draw.
|
||||
// l - Index of the cell to be selected when VK_LEFT is pressed.
|
||||
// u - Index of the cell to be selected when VK_UP is pressed.
|
||||
// r - Index of the cell to be selected when VK_RIGHT is pressed.
|
||||
// d - Index of the cell to be selected when VK_DOWN is pressed.
|
||||
// Summary: This member function is called by the class to draw a single large
|
||||
// color cell.
|
||||
void DrawLargeCell(CDC* pDC, CPoint point, COLORREF clr, int l, int u, int r, int d);
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// Summary: This member function is called to draw the selection window.
|
||||
void DrawColorSelector(CDC* pDC);
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// Summary: This member function is called to select a color cell if any are selected.
|
||||
void DrawSelectCell(CDC* pDC);
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// Summary: This member function is called to select a large color cell if any
|
||||
// are selected.
|
||||
void DrawLargeSelectCell(CDC* pDC);
|
||||
|
||||
// Input: point - Current location of the color to select.
|
||||
// Summary: This member function updates the color selection based on the XY
|
||||
// coordinates specified by 'point'.
|
||||
void UpdateSelection(CPoint point);
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// Summary: This member function is called to select a cell when a new selection is made.
|
||||
void SelectColorCell(CDC* pDC);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTColorHex)
|
||||
protected:
|
||||
virtual void PreSubclassWindow();
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual bool IsValidColor(COLORREF cr) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTColorHex)
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
|
||||
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE COLORREF CXTColorHex::GetSelectedColor() const {
|
||||
return m_clrColor;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTColorPageStandard is a multiple inheritance class derived from
|
||||
// CXTDialogState and CPropertyPage. It is used to create a CXTColorPageStandard
|
||||
// dialog.
|
||||
class _XT_EXT_CLASS CXTColorPageStandard : CXTDialogState, public CPropertyPage
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTColorPageStandard)
|
||||
|
||||
public:
|
||||
|
||||
// Input: pParentSheet - Points to the parent property sheet.
|
||||
// Summary: Constructs a CXTColorPageStandard object.
|
||||
CXTColorPageStandard(CXTColorDialog* pParentSheet=NULL);
|
||||
|
||||
// Summary: Destroys a CXTColorPageStandard object, handles cleanup and de-allocation.
|
||||
virtual ~CXTColorPageStandard();
|
||||
|
||||
// Input: clr - An RGB value that represents the color.
|
||||
// Summary: This member function is called to set the selected color for the page.
|
||||
void SetColor(COLORREF clr);
|
||||
|
||||
protected:
|
||||
|
||||
CXTColorDialog* m_pParentSheet; // Points to the parent property sheet.
|
||||
|
||||
//{{AFX_DATA(CXTColorPageStandard)
|
||||
|
||||
enum { IDD = XT_IDD_COLORSTANDARD };
|
||||
CXTColorHex m_colorHex;
|
||||
//}}AFX_DATA
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTColorPageStandard)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX);
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTColorPageStandard)
|
||||
afx_msg void OnPaint();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnUpdateColor(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTColorPageStandard::SetColor(COLORREF clr) {
|
||||
m_colorHex.SetSelectedColor(clr);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(__XTCOLORSTANDARD_H__)
|
||||
187
Editor/XT/Include/XTColorPicker.h
Normal file
187
Editor/XT/Include/XTColorPicker.h
Normal file
@@ -0,0 +1,187 @@
|
||||
// XTColorPicker.h : interface for the CXTColorPicker class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTCOLORPICKER_H__)
|
||||
#define __XTCOLORPICKER_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
// class forwards
|
||||
|
||||
class CXTColorPopup;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTColorPicker is a CButton derived class. It displays a color picker
|
||||
// popup window (CXTColorPopup) for Office™ style color selection.
|
||||
class _XT_EXT_CLASS CXTColorPicker : public CButton
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTColorPicker)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTColorPicker object.
|
||||
CXTColorPicker();
|
||||
|
||||
// Summary: Destroys a CXTColorPicker object, handles cleanup and de-allocation.
|
||||
virtual ~CXTColorPicker();
|
||||
|
||||
protected:
|
||||
|
||||
BOOL m_bShowText; // TRUE if the color picker displays text.
|
||||
BOOL m_bColorText; // TRUE if the color picker text is colorized, only valid if m_bShowText is TRUE.
|
||||
BOOL m_bPopupActive; // TRUE if the popup window is currently active.
|
||||
bool m_bInitControl; // true for initialization.
|
||||
DWORD m_dwPopup; // Represents the style for the color picker.
|
||||
COLORREF m_clrSelected; // An RGB value that represents the color for the display color.
|
||||
COLORREF m_clrDefault; // An RGB value that represents the color for the default color.
|
||||
|
||||
public:
|
||||
|
||||
// Input: clr - An RGB value that represents the new RGB color for the control.
|
||||
// Summary: This member function will set the color value for the color picker.
|
||||
virtual void SetColor(COLORREF clr);
|
||||
|
||||
// Returns: An RGB color value that represents the currently selected color.
|
||||
// Summary: This member function will return the currently selected color.
|
||||
virtual COLORREF GetColor() const;
|
||||
|
||||
// Input: bShowText - TRUE to display button text.
|
||||
// Summary: This member function will display any text associated with the color
|
||||
// picker button control. If the button has text, then it will be displayed.
|
||||
virtual void ShowText(BOOL bShowText);
|
||||
|
||||
// Returns: TRUE if the color picker displays text, otherwise returns FALSE.
|
||||
// Summary: This member function will determine if text is displayed for the color
|
||||
// picker button control.
|
||||
virtual BOOL IsTextShown() const;
|
||||
|
||||
// Input: bColorText - TRUE to display the button text in color.
|
||||
// Summary: This member function will display any text associated with the color picker
|
||||
// button control in color.
|
||||
virtual void ShowTextInColor(BOOL bColorText);
|
||||
|
||||
// Returns: TRUE if the button text is in color, otherwise returns FALSE.
|
||||
// Summary: This member function will determine if the text for the color picker button
|
||||
// control is displayed in color.
|
||||
virtual BOOL IsTextInColor() const;
|
||||
|
||||
// Input: clrDefault - An RGB value that represents the default color for the
|
||||
// color picker.
|
||||
// Summary: This member function will set the default RGB color value for the
|
||||
// color picker.
|
||||
virtual void SetDefaultColor(COLORREF clrDefault);
|
||||
|
||||
// Returns: An RGB value that represents the default color value for the color picker.
|
||||
// Summary: This member function will return the default RGB color value for
|
||||
// the color picker.
|
||||
virtual COLORREF GetDefaultColor() const;
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwRemove - Specifies the window styles to be removed during style modification.
|
||||
// dwAdd - Specifies the window styles to be added during style modification.
|
||||
// Summary: Call this member function to modify the color picker style. Styles
|
||||
// to be added or removed can be combined by using the bitwise OR (|)
|
||||
// operator. It can be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>CPS_XT_NOFILL</b> The color picker will display a No Fill
|
||||
// button rather than the default Automatic Color button.[/li]
|
||||
// [li]<b>CPS_XT_EXTENDED</b> The color picker will display 40 extended
|
||||
// colors rather than the default 16 colors.[/li]
|
||||
// [li]<b>CPS_XT_MORECOLORS</b> The color picker will display a More
|
||||
// Colors button which will display a CXTColorDialog.[/li]
|
||||
// [li]<b>CPS_XT_SHOW3DSELECTION</b> Displays the color selection
|
||||
// box with a 3D raised border in CXTColorDialog.[/li]
|
||||
// [li]<b>CPS_XT_SHOWHEXVALUE</b> Displays the hex equivalent of the
|
||||
// selected color.[/li]
|
||||
// [/ul]
|
||||
virtual void ModifyCPStyle(DWORD dwRemove,DWORD dwAdd);
|
||||
|
||||
// Summary: This member function will activate the color picker and display the
|
||||
// color popup window.
|
||||
virtual void ShowPopupWindow();
|
||||
|
||||
protected:
|
||||
|
||||
// Returns: An RGB value either BLACK or WHITE.
|
||||
// Summary: This member function is called to return the contrast color for the color
|
||||
// picker button. The contrast color is used when text is displayed to
|
||||
// contrast with the currently selected color. For example, if the currently
|
||||
// selected color is WHITE then BLACK would be returned so the text is legible.
|
||||
virtual COLORREF GetContrastColor() const;
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTColorPicker)
|
||||
public:
|
||||
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
protected:
|
||||
virtual void PreSubclassWindow();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTColorPicker)
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnPaint();
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnSelChange(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnDropDown(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnCloseUp(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnSelEndOK(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnSelEndCancel(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnSelNoFill(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg void OnShowPopup();
|
||||
afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE COLORREF CXTColorPicker::GetColor() const {
|
||||
return m_clrSelected;
|
||||
}
|
||||
AFX_INLINE void CXTColorPicker::ShowText(BOOL bShowText) {
|
||||
m_bShowText = bShowText; RedrawWindow();
|
||||
}
|
||||
AFX_INLINE BOOL CXTColorPicker::IsTextShown() const {
|
||||
return m_bShowText;
|
||||
}
|
||||
AFX_INLINE void CXTColorPicker::ShowTextInColor(BOOL bColorText) {
|
||||
m_bColorText = bColorText; RedrawWindow();
|
||||
}
|
||||
AFX_INLINE BOOL CXTColorPicker::IsTextInColor() const {
|
||||
return m_bColorText;
|
||||
}
|
||||
AFX_INLINE void CXTColorPicker::SetDefaultColor(COLORREF clrDefault) {
|
||||
m_clrDefault = clrDefault; RedrawWindow();
|
||||
}
|
||||
AFX_INLINE COLORREF CXTColorPicker::GetDefaultColor() const {
|
||||
return m_clrDefault;
|
||||
}
|
||||
AFX_INLINE void CXTColorPicker::ModifyCPStyle(DWORD dwRemove, DWORD dwAdd) {
|
||||
m_dwPopup &= ~dwRemove; m_dwPopup |= dwAdd; RedrawWindow();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTCOLORPICKER_H__)
|
||||
152
Editor/XT/Include/XTColorPopup.h
Normal file
152
Editor/XT/Include/XTColorPopup.h
Normal file
@@ -0,0 +1,152 @@
|
||||
// XTColorPopup.h : interface for the CXTColorPopup class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTCOLORPOPUP_H__)
|
||||
#define __XTCOLORPOPUP_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTColorPopup is a CXTColorSelectorCtrl derived class. It is used to create a CXTColorPopup
|
||||
// window that will allow a user to select colors and add custom colors
|
||||
// to a color list.
|
||||
class _XT_EXT_CLASS CXTColorPopup : public CXTColorSelectorCtrl
|
||||
{
|
||||
public:
|
||||
|
||||
// Input: bAutoDelete - TRUE if the color picker window is to be self deleting.
|
||||
// callerParam - Caller parameter, will be reported back as an LPARAM of
|
||||
// color popup notification messages.
|
||||
// Summary: Constructs a CXTColorPopup object.
|
||||
CXTColorPopup(BOOL bAutoDelete=FALSE, LPARAM callerParam = 0);
|
||||
|
||||
// Summary: Destroys a CXTColorPopup object, handles cleanup and de-allocation.
|
||||
virtual ~CXTColorPopup();
|
||||
|
||||
protected:
|
||||
|
||||
BOOL m_bAutoDelete; // TRUE if the popup window is to be self deleting.
|
||||
BOOL m_bDisplayShadow; // TRUE if the popup window shall render its shadow.
|
||||
CRect m_rcExclude; // Area to exclude from shadow display.
|
||||
const LPARAM m_callerParam; // Caller parameter that will be reported back as an LPARAM of all notification messages.
|
||||
|
||||
public:
|
||||
|
||||
// Input: clrColor - An RGB value that represents the user defined color to display in
|
||||
// the recent color list.
|
||||
// Summary: This member function will add a color to the user defined color list.
|
||||
static void AddUserColor(COLORREF clrColor);
|
||||
|
||||
// Summary: Call this member function to reset the user defined color list. Calling
|
||||
// this function will remove all user defined colors from the MRU list.
|
||||
static void ResetUserColors();
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: rect - A reference to a CRect object that represents the
|
||||
// size of the color popup window.
|
||||
// pParentWnd - Points to the parent window for the color popup.
|
||||
// dwPopup - Style for the popup window. Styles can be one or
|
||||
// more of the following:
|
||||
// [ul]
|
||||
// [li]<b>CPS_XT_NOFILL</b> The color picker will display a No Fill
|
||||
// button rather than the default Automatic Color button.[/li]
|
||||
// [li]<b>CPS_XT_EXTENDED</b> The color picker will display 40
|
||||
// extended colors rather than the default 16 colors.[/li]
|
||||
// [li]<b>CPS_XT_MORECOLORS</b> The color picker will display
|
||||
// a More Colors button which will display a CXTColorDialog.[/li]
|
||||
// [li]<b>CPS_XT_SHOW3DSELECTION</b> Displays the color selection
|
||||
// box with a 3D raised border in CXTColorDialog.[/li]
|
||||
// [li]<b>CPS_XT_SHOWHEXVALUE</b> Displays the hex equivalent
|
||||
// of the selected color.[/li]
|
||||
// [/ul]
|
||||
// clrColor - An RGB value that represents the currently selected color for the
|
||||
// popup window.
|
||||
// clrDefault - Specifies the default color for the color popup. If the
|
||||
// current style includes CPS_NOFILL this parameter is ignored.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function handles the creation of the color popup window.
|
||||
virtual BOOL Create(CRect& rect,CWnd* pParentWnd,DWORD dwPopup,COLORREF clrColor,COLORREF clrDefault=CLR_DEFAULT);
|
||||
|
||||
// Input: hwndListener - A handle to the listener window. Messages will be sent to it.
|
||||
// Summary: This member function adds a window to send color picker notifications to.
|
||||
void AddListener(HWND hwndListener);
|
||||
|
||||
// Input: bDisplayShadow - Flag that tells if the shadow is to be displayed.
|
||||
// Summary: This member function enables or disables the drawing of popup shadows.
|
||||
// Call this function after instantiating the color popup as a part of an
|
||||
// object's initialization. Do <b>not</b> call it after popup creation since
|
||||
// doing so may cause unpredictable results.
|
||||
void DisplayShadow(BOOL bDisplayShadow = TRUE);
|
||||
|
||||
protected:
|
||||
|
||||
// Input: nCurSel - Current index of the selected color box or button
|
||||
// in the color popup window.
|
||||
// Summary: This member function will finish the selection process for the color
|
||||
// box or button in the color popup window.
|
||||
virtual void EndSelection(int nCurSel);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTColorPopup)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
protected:
|
||||
virtual void PostNcDestroy();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTColorPopup)
|
||||
afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnKillFocus(CWnd* pNewWnd);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnNcPaint();
|
||||
afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
|
||||
//}}AFX_MSG
|
||||
|
||||
public:
|
||||
#if _MFC_VER >= 0x0700 //MFC 7.0
|
||||
afx_msg void OnActivateApp(BOOL bActive, DWORD dwThreadID);
|
||||
#else
|
||||
afx_msg void OnActivateApp(BOOL bActive, HTASK hTask);
|
||||
#endif //MFC 7.0
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTColorPopup::AddUserColor(COLORREF clrColor) {
|
||||
m_arUserDefColors.Add( clrColor );
|
||||
}
|
||||
AFX_INLINE void CXTColorPopup::ResetUserColors() {
|
||||
m_arUserDefColors.RemoveAll();
|
||||
}
|
||||
AFX_INLINE void CXTColorPopup::DisplayShadow( BOOL bDisplayShadow/* = TRUE*/) {
|
||||
m_bDisplayShadow = bDisplayShadow;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_COLORPOPUP_H__C0330BB1_9A77_4EE4_9F15_00ECAFC5FFC9__INCLUDED_)
|
||||
476
Editor/XT/Include/XTColorRef.h
Normal file
476
Editor/XT/Include/XTColorRef.h
Normal file
@@ -0,0 +1,476 @@
|
||||
// XTColorRef.h: interface for the CXTColorRef class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTCOLORREF_H__)
|
||||
#define __XTCOLORREF_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTColorRef is a stand alone class. It is used to create a
|
||||
// CXTColorRef object. This object is used for manipulation of RGB values.
|
||||
class _XT_EXT_CLASS CXTColorRef
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTColorRef object.
|
||||
CXTColorRef();
|
||||
|
||||
// Input: r - An RGB value.
|
||||
// Summary: Constructs a CXTColorRef object.
|
||||
CXTColorRef(COLORREF r);
|
||||
|
||||
// Input: r - Specifies the intensity of the red color component. 'r' can range
|
||||
// from 0 to 255. Zero is the minimum color intensity; 255 is the maximum
|
||||
// color intensity.
|
||||
// g - Specifies the intensity of the green color component. 'g' can range
|
||||
// from 0 to 255. Zero is the minimum color intensity; 255 is the maximum
|
||||
// color intensity.
|
||||
// b - Specifies the intensity of the blue color component. 'b' can range
|
||||
// from 0 to 255. Zero is the minimum color intensity; 255 is the maximum
|
||||
// color intensity.
|
||||
// Summary: Constructs a CXTColorRef object.
|
||||
CXTColorRef(int r, int g, int b);
|
||||
|
||||
// Input: cr - An RGB value.
|
||||
// Returns: A reference to a valid CXTColorRef object.
|
||||
// Summary: This assignment operator is used to initialize a CXTColorRef object.
|
||||
CXTColorRef& operator = (COLORREF cr);
|
||||
|
||||
// Input: val - Specifies the intensity of the color component. 'val' can range from
|
||||
// 0 to 255. Zero is the minimum color intensity; 255 is the maximum
|
||||
// color intensity.
|
||||
// Returns: A CXTColorRef object.
|
||||
// Summary: This assignment operator is used to modify a CXTColorRef object.
|
||||
CXTColorRef operator + (int val) const;
|
||||
|
||||
// Input: val - Specifies the intensity of the color component. 'val' can range from
|
||||
// 0 to 255. Zero is the minimum color intensity; 255 is the maximum
|
||||
// color intensity.
|
||||
// Returns: A CXTColorRef object.
|
||||
// Summary: This assignment operator is used to modify a CXTColorRef object.
|
||||
CXTColorRef operator - (int val) const;
|
||||
|
||||
// Input: val - Specifies the intensity of the color component. 'val' can range from
|
||||
// 0 to 255. Zero is the minimum color intensity; 255 is the maximum
|
||||
// color intensity.
|
||||
// Returns: A CXTColorRef object.
|
||||
// Summary: This assignment operator is used to modify a CXTColorRef object.
|
||||
CXTColorRef operator * (int val) const;
|
||||
|
||||
// Input: val - Specifies the intensity of the color component. 'val' can range from
|
||||
// 0 to 255. Zero is the minimum color intensity; 255 is the maximum
|
||||
// color intensity.
|
||||
// Returns: A CXTColorRef object.
|
||||
// Summary: This assignment operator is used to modify a CXTColorRef object.
|
||||
CXTColorRef operator / (int val) const;
|
||||
|
||||
// Input: cr - An RGB value.
|
||||
// Returns: A CXTColorRef object.
|
||||
// Summary: This assignment operator is used to modify a CXTColorRef object.
|
||||
CXTColorRef operator + (COLORREF cr) const;
|
||||
|
||||
// Input: cr - An RGB value.
|
||||
// Returns: A CXTColorRef object.
|
||||
// Summary: This assignment operator is used to modify a CXTColorRef object.
|
||||
CXTColorRef operator - (COLORREF cr) const;
|
||||
|
||||
// Input: cr - An RGB value.
|
||||
// Returns: A CXTColorRef object.
|
||||
// Summary: This assignment operator is used to modify a CXTColorRef object.
|
||||
CXTColorRef operator * (COLORREF cr) const;
|
||||
|
||||
// Input: cr - An RGB value.
|
||||
// Returns: A CXTColorRef object.
|
||||
// Summary: This assignment operator is used to modify a CXTColorRef object.
|
||||
CXTColorRef operator / (COLORREF cr) const;
|
||||
|
||||
// Input: val - Specifies the intensity of the color component. 'val' can range from
|
||||
// 0 to 255. Zero is the minimum color intensity; 255 is the maximum
|
||||
// color intensity.
|
||||
// Returns: A reference to a valid CXTColorRef object.
|
||||
// Summary: This assignment operator is used to modify a CXTColorRef object.
|
||||
CXTColorRef& operator += (int val);
|
||||
|
||||
// Input: val - Specifies the intensity of the color component. 'val' can range from
|
||||
// 0 to 255. Zero is the minimum color intensity; 255 is the maximum
|
||||
// color intensity.
|
||||
// Returns: A reference to a valid CXTColorRef object.
|
||||
// Summary: This assignment operator is used to modify a CXTColorRef object.
|
||||
CXTColorRef& operator -= (int val);
|
||||
|
||||
// Input: val - Specifies the intensity of the color component. 'val' can range from
|
||||
// 0 to 255. Zero is the minimum color intensity; 255 is the maximum
|
||||
// color intensity.
|
||||
// Returns: A reference to a valid CXTColorRef object.
|
||||
// Summary: This assignment operator is used to modify a CXTColorRef object.
|
||||
CXTColorRef& operator *= (int val);
|
||||
|
||||
// Input: val - Specifies the intensity of the color component. 'val' can range from
|
||||
// 0 to 255. Zero is the minimum color intensity; 255 is the maximum
|
||||
// color intensity.
|
||||
// Returns: A reference to a valid CXTColorRef object.
|
||||
// Summary: This assignment operator is used to modify a CXTColorRef object.
|
||||
CXTColorRef& operator /= (int val);
|
||||
|
||||
// Input: cr - An RGB value.
|
||||
// Returns: A reference to a valid CXTColorRef object.
|
||||
// Summary: This assignment operator is used to modify a CXTColorRef object.
|
||||
CXTColorRef& operator += (COLORREF cr);
|
||||
|
||||
// Input: cr - An RGB value.
|
||||
// Returns: A reference to a valid CXTColorRef object.
|
||||
// Summary: This assignment operator is used to modify a CXTColorRef object.
|
||||
CXTColorRef& operator -= (COLORREF cr);
|
||||
|
||||
// Input: cr - An RGB value.
|
||||
// Returns: A reference to a valid CXTColorRef object.
|
||||
// Summary: This assignment operator is used to modify a CXTColorRef object.
|
||||
CXTColorRef& operator *= (COLORREF cr);
|
||||
|
||||
// Input: cr - An RGB value.
|
||||
// Returns: A reference to a valid CXTColorRef object.
|
||||
// Summary: This assignment operator is used to modify a CXTColorRef object.
|
||||
CXTColorRef& operator /= (COLORREF cr);
|
||||
|
||||
// Returns: An RGB value.
|
||||
// Summary: This operator retrieves the RGB value for the CXTColorRef object.
|
||||
operator COLORREF () const;
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// RGB Values
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
// Returns: The red component of the color.
|
||||
// Summary: This method gets the red component of this object.
|
||||
int getRValue() const;
|
||||
|
||||
// Returns: The green component of the color.
|
||||
// Summary: This method gets the green component of this object.
|
||||
int getGValue() const;
|
||||
|
||||
// Returns: The blue component of the color.
|
||||
// Summary: This method gets the blue component of this object.
|
||||
int getBValue() const;
|
||||
|
||||
// Input: val - Specifies the intensity of the color component. 'val' can range from
|
||||
// 0 to 255. Zero is the minimum color intensity; 255 is the maximum
|
||||
// color intensity.
|
||||
// Summary: Call this member function to set the red intensity value for the CXTColorRef
|
||||
// object.
|
||||
void setRValue(int val);
|
||||
|
||||
// Input: val - Specifies the intensity of the color component. 'val' can range from
|
||||
// 0 to 255. Zero is the minimum color intensity; 255 is the maximum
|
||||
// color intensity.
|
||||
// Summary: Call this member function to set the green intensity value for the
|
||||
// CXTColorRef object.
|
||||
void setGValue(int val);
|
||||
|
||||
// Input: val - Specifies the intensity of the color component. 'val' can range from
|
||||
// 0 to 255. Zero is the minimum color intensity; 255 is the maximum
|
||||
// color intensity.
|
||||
// Summary: Call this member function to set the blue intensity value for the CXTColorRef
|
||||
// object.
|
||||
void setBValue(int val);
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Misc Information
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
// Returns: A double that represents the current color intensity.
|
||||
// Summary: This member function will retrieve the overall intensity of the
|
||||
// CXTColorRef object.
|
||||
double getIntensity() const;
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Color Conversion
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
// Input: h - The variable to receive the hue value.
|
||||
// s - The variable to receive the saturation value.
|
||||
// l - The variable to receive the luminance value.
|
||||
// Summary: This function converts the RGB color to an HSL (hue, saturation,
|
||||
// luminance) trio.
|
||||
void toHSL(double& h, double& s, double& l) const;
|
||||
|
||||
// Input: h - The variable to receive the hue value.
|
||||
// s - The variable to receive the saturation value.
|
||||
// b - The variable to receive the brightness value.
|
||||
// Summary: This function converts the RGB color to an HSB (hue, saturation,
|
||||
// brightness) trio.
|
||||
void toHSB(double& h, double& s, double& b) const;
|
||||
|
||||
// Input: h - The hue of the source color.
|
||||
// s - The saturation of the source color.
|
||||
// l - The luminance of the source color.
|
||||
// Summary: This function sets an RGB value that is the equivalent of a specific
|
||||
// HSL (hue, saturation, luminance) color.
|
||||
void setHSL(double h, double s, double l);
|
||||
|
||||
// Input: h - The hue of the source color.
|
||||
// s - The saturation of the source color.
|
||||
// b - The brightness of the source color.
|
||||
// Summary: This function sets an RGB value that is the equivalent of a specific
|
||||
// HSB (hue, saturation, brightness) color.
|
||||
void setHSB(double h, double s, double b);
|
||||
|
||||
// Input: h - The hue of the source color.
|
||||
// s - The saturation of the source color.
|
||||
// l - The luminance of the source color.
|
||||
// Summary: This static function creates a new CXTColorRef object out of an HSL
|
||||
// (hue, saturation, luminance) color trio. Returns a CXTColorRef object.
|
||||
static CXTColorRef fromHSL(double h, double s, double l);
|
||||
|
||||
// Input: h - The hue of the source color.
|
||||
// s - The saturation of the source color.
|
||||
// b - The brightness of the source color.
|
||||
// Summary: This static function creates a new CXTColorRef object out of an HSB
|
||||
// (hue, saturation, brightness) color trio. Returns a CXTColorRef object.
|
||||
static CXTColorRef fromHSB(double h, double s, double b);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Color Manipulation
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Input: clr - A reference to a valid CXTColorRef object.
|
||||
// opacity - The amount of transparency.
|
||||
// Returns: A reference to a valid CXTColorRef object.
|
||||
// Summary: Call this member function to blend the CXTColorRef object with the
|
||||
// object specified by 'clr'.
|
||||
CXTColorRef& blend(const CXTColorRef& clr, int opacity);
|
||||
|
||||
// Input: clr - A reference to a valid CXTColorRef object.
|
||||
// Returns: A reference to a valid CXTColorRef object.
|
||||
// Summary: Call this member function to add the CXTColorRef object specified by 'clr'.
|
||||
CXTColorRef& add(const CXTColorRef& clr);
|
||||
|
||||
// Input: clr - A reference to a valid CXTColorRef object.
|
||||
// Returns: A reference to a valid CXTColorRef object.
|
||||
// Summary: Call this member function to subtract the CXTColorRef object specified
|
||||
// by 'clr'.
|
||||
CXTColorRef& subtract(const CXTColorRef& clr);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Standard Colors
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
static const CXTColorRef BLACK; // RGB value that represents the color black.
|
||||
static const CXTColorRef WHITE; // RGB value that represents the color white.
|
||||
static const CXTColorRef GRAY_25; // RGB value that represents the 25% gray color.
|
||||
static const CXTColorRef GRAY_50; // RGB value that represents the 50% gray color.
|
||||
static const CXTColorRef GRAY_75; // RGB value that represents the 75% gray color.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Helper Functions
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Input: iVal - Specifies the color intensity which is the source of
|
||||
// the operation.
|
||||
// iAdd - Specifies the intensity to add to the source. It can be
|
||||
// negative.
|
||||
// Summary: This member function adds two color intensities, ensuring that the
|
||||
// sum is in the proper color value range (0-255). For example,
|
||||
// addColorValue(200, 100) will return 255 and not 300.
|
||||
// addColorValue(100, -200) will return 0.
|
||||
static inline int addColorValue(int iVal, int iAdd);
|
||||
|
||||
// Input: iVal - Specifies the color intensity which is the source of the operation.
|
||||
// iMult - Specifies a value by which to multiply the source.
|
||||
// iDiv - Specifies a value by which to divide the source.
|
||||
// Summary: This member function manipulates a color value by performing a
|
||||
// multiplication and then a division. For instance,
|
||||
// multiplyColorValue(10, 2, 3) will return 10 * 2 / 3 which is 6.
|
||||
// The function guarantees that the resulting value does not exceeded 255.
|
||||
static inline int multiplyColorValue(int iVal, int iMult, int iDiv);
|
||||
|
||||
// Input: iClrFront - Specifies the intensity of the foreground color component.
|
||||
// 'iClrFront' can range from 0 to 255. Zero is the minimum color intensity;
|
||||
// 255 is the maximum color intensity.
|
||||
// iClrBack - Specifies the intensity of the background color component.
|
||||
// 'iClrBack' can range from 0 to 255. Zero is the minimum color intensity;
|
||||
// 255 is the maximum color intensity.
|
||||
// opacity - The amount of transparency.
|
||||
// Summary: This function takes a blended color intensity which is (100-opacity)%
|
||||
// * iClrFront and opacity% * iClrBack.
|
||||
static inline int BlendColor(int iClrFront, int iClrBack, int opacity);
|
||||
|
||||
// Input: iVal - Specifies the intensity of the color component. 'iVal' can range
|
||||
// from 0 to 255. Zero is the minimum color intensity; 255 is the maximum
|
||||
// color intensity.
|
||||
// Summary: This function takes in a color intensity and ensures that it is between
|
||||
// 0-255. Anything out of range will be adjusted to the closest number
|
||||
// in range (i.e. -100 will become 0, 300 will become 255).
|
||||
static int fixColorValue(int iVal);
|
||||
|
||||
// Summary: This function will refresh the display element colors defined in the
|
||||
// CXTColorRef object.
|
||||
static void RefreshColors();
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: nIndex - Specifies the display element whose color is to be retrieved.
|
||||
// This parameter can be one of the following values:
|
||||
// [ul]
|
||||
// [li]<b>XPCOLOR_BASE</b> An RGB value that represents the XP base color.[/li]
|
||||
// [li]<b>XPCOLOR_BARFACE</b> An RGB value that represents the XP toolbar
|
||||
// background color.[/li]
|
||||
// [li]<b>XPCOLOR_HIGHLIGHT</b> An RGB value that represents the XP menu item
|
||||
// selected color.[/li]
|
||||
// [li]<b>XPCOLOR_HIGHLIGHT_BORDER</b> An RGB value that represents the XP menu
|
||||
// item selected border color.[/li]
|
||||
// [li]<b>XPCOLOR_HIGHLIGHT_PUSHED</b> An RGB value that represents the XP menu
|
||||
// item pushed color.[/li]
|
||||
// [li]<b>XPCOLOR_ICONSHADDOW</b> An RGB value that represents the XP menu item
|
||||
// icon shadow.[/li]
|
||||
// [li]<b>XPCOLOR_GRAYTEXT</b> An RGB value that represents the XP menu item
|
||||
// disabled text color.[/li]
|
||||
// [li]<b>XPCOLOR_HIGHLIGHT_CHECKED</b> An RGB value that represents the XP menu
|
||||
// item checked color.[/li]
|
||||
// [li]<b>XPCOLOR_HIGHLIGHT_CHECKED_BORDER</b> An RGB value that represents the
|
||||
// XP menu item checked border color.[/li]
|
||||
// [li]<b>XPCOLOR_GRIPPER</b> An RGB value that represents the XP toolbar gripper
|
||||
// color.[/li]
|
||||
// [li]<b>XPCOLOR_SEPARATOR</b> An RGB value that represents the XP toolbar
|
||||
// separator color.[/li]
|
||||
// [li]<b>XPCOLOR_DISABLED</b> An RGB value that represents the XP menu icon
|
||||
// disabled color.[/li]
|
||||
// [li]<b>XPCOLOR_MENUTEXT_BACK</b> An RGB value that represents the XP menu
|
||||
// item text background color.[/li]
|
||||
// [li]<b>XPCOLOR_MENU_EXPANDED</b> An RGB value that represents the XP hidden
|
||||
// menu commands background color.[/li]
|
||||
// [li]<b>XPCOLOR_MENU_BORDER</b> An RGB value that represents the XP menu
|
||||
// border color.[/li]
|
||||
// [li]<b>XPCOLOR_MENUTEXT</b> An RGB value that represents the XP menu item
|
||||
// text color.[/li]
|
||||
// [li]<b>XPCOLOR_HIGHLIGHT_TEXT</b> An RGB value that represents the XP menu
|
||||
// item selected text color.[/li]
|
||||
// [li]<b>XPCOLOR_BARTEXT</b> An RGB value that represents the XP toolbar text
|
||||
// color.[/li]
|
||||
// [li]<b>XPCOLOR_BARTEXT_PUSHED</b> An RGB value that represents the XP toolbar
|
||||
// pushed text color.[/li]
|
||||
// [li]<b>XPCOLOR_TAB_INACTIVE_BACK</b> An RGB value that represents the XP
|
||||
// inactive tab background color.[/li]
|
||||
// [li]<b>XPCOLOR_TAB_INACTIVE_TEXT</b> An RGB value that represents the XP
|
||||
// inactive tab text color.[/li]
|
||||
// [/ul]
|
||||
// Returns: The red, green, blue (RGB) color value of the given element.
|
||||
// Summary: This function retrieves the current color of the specified xp display
|
||||
// element. Display elements are the parts of a window and the display that
|
||||
// appear on the system display screen.
|
||||
static COLORREF GetColor(int nIndex);
|
||||
|
||||
protected:
|
||||
|
||||
COLORREF m_ColorRef; // Current RGB value for this object.
|
||||
|
||||
// Input: temp1 - Temp value.
|
||||
// temp2 - Temp value.
|
||||
// temp3 - Temp value.
|
||||
// Returns: A double that represents either an r, g, or b COLORREF value.
|
||||
// Summary: This member function is called by setHSL() to convert hue.
|
||||
static double HuetoRGB(double temp1, double temp2, double temp3);
|
||||
|
||||
// Input: r - Specifies the intensity of the red color component. 'r' can range
|
||||
// from 0 to 255. Zero is the minimum color intensity; 255 is the maximum
|
||||
// color intensity.
|
||||
// g - Specifies the intensity of the green color component. 'g' can range
|
||||
// from 0 to 255. Zero is the minimum color intensity; 255 is the maximum
|
||||
// color intensity.
|
||||
// b - Specifies the intensity of the blue color component. 'b' can range
|
||||
// from 0 to 255. Zero is the minimum color intensity; 255 is the maximum
|
||||
// color intensity.
|
||||
// Returns: An RGB value.
|
||||
// Summary: This function takes in a color intensity and ensures that it is between
|
||||
// 0-255. Anything out of range will be adjusted to the closest number
|
||||
// in range (i.e. -100 will become 0, 300 will become 255).
|
||||
static COLORREF SafeRGB(int r, int g, int b);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// XP Color Functions
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
private:
|
||||
static COLORREF m_arrColor[50];
|
||||
|
||||
static void RefreshSysColors();
|
||||
static void RefreshXPColors();
|
||||
|
||||
static float ColorWidth(int nLength, int nWidth);
|
||||
static float ColorDelta(COLORREF clrA, COLORREF clrB);
|
||||
static float Length(COLORREF clrA, COLORREF clrB);
|
||||
static BOOL LongColor(COLORREF clrMain, COLORREF clrSub, BOOL bCalcLength, float fDistance);
|
||||
static COLORREF MixColor(COLORREF clrMain, COLORREF clrSub, float fDistance);
|
||||
static COLORREF AdjustColor(COLORREF clrMain, COLORREF clrSub, float fDistance);
|
||||
static COLORREF LightColor(COLORREF clrLight, COLORREF clrDark, int nDelta);
|
||||
|
||||
static double GetRDelta(COLORREF clr) { return GetRValue(clr) * (195.0/255.0); };
|
||||
static double GetGDelta(COLORREF clr) { return GetGValue(clr) * (390.0/255.0); };
|
||||
static double GetBDelta(COLORREF clr) { return GetBValue(clr) * (65.0/255.0); };
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE CXTColorRef::CXTColorRef() {
|
||||
}
|
||||
AFX_INLINE CXTColorRef::CXTColorRef(COLORREF r) {
|
||||
*this = r;
|
||||
}
|
||||
AFX_INLINE CXTColorRef::CXTColorRef(int r, int g, int b) {
|
||||
*this = RGB(r, g, b);
|
||||
}
|
||||
AFX_INLINE CXTColorRef& CXTColorRef::operator = (COLORREF cr) {
|
||||
m_ColorRef = cr; return *this;
|
||||
}
|
||||
AFX_INLINE CXTColorRef::operator COLORREF () const {
|
||||
return m_ColorRef;
|
||||
}
|
||||
AFX_INLINE int CXTColorRef::getRValue() const {
|
||||
return GetRValue(m_ColorRef);
|
||||
}
|
||||
AFX_INLINE int CXTColorRef::getGValue() const {
|
||||
return GetGValue(m_ColorRef);
|
||||
}
|
||||
AFX_INLINE int CXTColorRef::getBValue() const {
|
||||
return GetBValue(m_ColorRef);
|
||||
}
|
||||
AFX_INLINE void CXTColorRef::setRValue(int val) {
|
||||
m_ColorRef = RGB(val, getGValue(), getBValue());
|
||||
}
|
||||
AFX_INLINE void CXTColorRef::setGValue(int val) {
|
||||
m_ColorRef = RGB(getRValue(), val, getBValue());
|
||||
}
|
||||
AFX_INLINE void CXTColorRef::setBValue(int val) {
|
||||
m_ColorRef = RGB(getRValue(), getGValue(), val);
|
||||
}
|
||||
AFX_INLINE double CXTColorRef::getIntensity() const {
|
||||
return ((299 * getRValue()) + (587 * getGValue()) + (114 * getBValue())) / 1000.0;
|
||||
}
|
||||
AFX_INLINE int CXTColorRef::addColorValue(int iVal, int iAdd) {
|
||||
return fixColorValue(iVal + iAdd);
|
||||
}
|
||||
AFX_INLINE int CXTColorRef::multiplyColorValue(int iVal, int iMult, int iDiv) {
|
||||
return fixColorValue(iVal * iMult / iDiv);
|
||||
}
|
||||
AFX_INLINE int CXTColorRef::BlendColor(int iClrFront, int iClrBack, int opacity) {
|
||||
return fixColorValue(((iClrFront * opacity) + (iClrBack * (100 - opacity))) / 100);
|
||||
}
|
||||
AFX_INLINE int CXTColorRef::fixColorValue(int iVal) {
|
||||
if (iVal > 255) return 255; if (iVal < 0) return 0; return iVal;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // !defined(__XTCOLORREF_H__)
|
||||
208
Editor/XT/Include/XTColorSelectorCtrl.h
Normal file
208
Editor/XT/Include/XTColorSelectorCtrl.h
Normal file
@@ -0,0 +1,208 @@
|
||||
// XTColorSelectorCtrl.h : interface for the CXTColorSelectorCtrl class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTCOLORCTRL_H__)
|
||||
#define __XTCOLORCTRL_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_COLOR_CELL is a stand alone helper structure class. It is used by
|
||||
// the CXTColorSelectorCtrl class.
|
||||
struct XT_COLOR_CELL
|
||||
{
|
||||
UINT nID; // Command ID of the color cell.
|
||||
UINT nIndex; // Index of the color cell.
|
||||
bool bChecked; // true if the cell is checked.
|
||||
CRect rect; // Size of the color cell.
|
||||
DWORD dwStyle; // Windows style for the cell.
|
||||
TCHAR szText[256]; // Tooltip text displayed for the color cell.
|
||||
COLORREF clr; // An RGB value that represents the color of the cell.
|
||||
};
|
||||
|
||||
// Summary: CList definition for the color cell structure array.
|
||||
typedef CList<XT_COLOR_CELL*,XT_COLOR_CELL*> CXTColorCellArray;
|
||||
|
||||
// Summary: Array of listener windows to send notifications to.
|
||||
typedef CArray<HWND, HWND> CXTListenerArray;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTColorSelectorCtrl is a CWnd derived class. It is used to create a CXTColorSelectorCtrl
|
||||
// control that will allow a user to select colors.
|
||||
class _XT_EXT_CLASS CXTColorSelectorCtrl : public CWnd
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTColorSelectorCtrl object.
|
||||
CXTColorSelectorCtrl();
|
||||
|
||||
// Summary: Destroys a CXTColorSelectorCtrl object, handles cleanup and de-allocation.
|
||||
virtual ~CXTColorSelectorCtrl();
|
||||
|
||||
protected:
|
||||
|
||||
int m_nRows; // Number of rows in the color popup window.
|
||||
int m_nCols; // Number of columns in the color popup window.
|
||||
int m_nLastIndex; // Index of the last button on the popup window.
|
||||
int m_nBtnCount; // Number of buttons in this window.
|
||||
int m_nCurSel; // Currently selected index.
|
||||
int m_nPressed; // Pressed button.
|
||||
BOOL m_bColorDlg; // TRUE if the color dialog is open.
|
||||
CWnd* m_pParentWnd; // Points to the parent window for the popup window.
|
||||
CSize m_sizeButton; // cx and cy size for a color picker button.
|
||||
CRect m_rcWnd; // Rect for the popup window.
|
||||
CRect m_rcBorders; // Control borders
|
||||
DWORD m_dwPopup; // Color popup window style.
|
||||
CPoint m_point; // Last known cursor position.
|
||||
COLORREF m_clrColor; // An RGB value that represents the currently selected color.
|
||||
COLORREF m_clrDefault; // An RGB value that represents the default color for the popup window.
|
||||
CToolTipCtrl m_tooltip; // Tooltip control.
|
||||
CXTListenerArray m_listeners; // Array of listener windows to be sent notifications.
|
||||
CXTColorCellArray m_arCells; // Array of color items.
|
||||
static CUIntArray m_arUserDefColors; // Array of user defined colors.
|
||||
|
||||
public:
|
||||
|
||||
// Input: pColorCell - Receives a pointer to the currently selected button.
|
||||
// Returns: The zero (0) based index of the currently selected button.
|
||||
// Summary: This member function will return the index of the currently selected
|
||||
// color and will initialize 'pColorCell' struct.
|
||||
int GetCurSel(XT_COLOR_CELL* pColorCell);
|
||||
|
||||
// Input: nIndex - An integer value that represents the zero (0) based
|
||||
// index of the button to be selected.
|
||||
// Summary: This member function will select a button based upon its index.
|
||||
void SetCurSel(int nIndex);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: rect - A reference to a CRect object that represents the
|
||||
// size of the color popup window.
|
||||
// pParentWnd - Points to the parent window for the color popup.
|
||||
// dwPopup - Style for the popup window. Styles can be one or
|
||||
// more of the following:
|
||||
// [ul]
|
||||
// [li]<b>CPS_XT_NOFILL</b> The color picker will display a No Fill
|
||||
// button rather than the default Automatic Color button.[/li]
|
||||
// [li]<b>CPS_XT_EXTENDED</b> The color picker will display 40
|
||||
// extended colors rather than the default 16 colors.[/li]
|
||||
// [li]<b>CPS_XT_MORECOLORS</b> The color picker will display
|
||||
// a More Colors button which will display a CXTColorDialog.[/li]
|
||||
// [li]<b>CPS_XT_SHOW3DSELECTION</b> Displays the color selection
|
||||
// box with a 3D raised border in CXTColorDialog.[/li]
|
||||
// [li]<b>CPS_XT_SHOWHEXVALUE</b> Displays the hex equivalent
|
||||
// of the selected color.[/li]
|
||||
// [/ul]
|
||||
// clrColor - An RGB value that represents the currently selected color for the
|
||||
// popup window.
|
||||
// clrDefault - Specifies the default color for the color popup. If the
|
||||
// current style includes CPS_NOFILL this parameter is
|
||||
// ignored.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function handles the creation of the color popup window.
|
||||
BOOL Create(CRect rect,CWnd* pParentWnd,DWORD dwPopup,COLORREF clrColor,COLORREF clrDefault=CLR_DEFAULT);
|
||||
|
||||
// Input: hwndListener - A handle to the listener window. Messages will be
|
||||
// sent to it.
|
||||
// Summary: This member function adds a window to send color picker notifications to.
|
||||
void AddListener(HWND hwndListener);
|
||||
|
||||
// Input: hwndListener - A handle to the listener window to remove.
|
||||
// Summary: This member function remove a window from notification list.
|
||||
void RemoveListener(HWND hwndListener);
|
||||
|
||||
// Input: pColorCell - Points to an XT_COLOR_CELL object.
|
||||
// Summary: This member function is called to select a color cell.
|
||||
void SelectColorCell(XT_COLOR_CELL* pColorCell);
|
||||
|
||||
// Input: clr - Color of selected cell.
|
||||
// Summary: This member function is called to select a color cell.
|
||||
void SelectColor(COLORREF clr);
|
||||
|
||||
// Input: iIndex - Index into the color cell array.
|
||||
// Returns: An XT_COLOR_CELL object.
|
||||
// Summary: This member function is called to return an XT_COLOR_CELL struct
|
||||
// from the color cell array.
|
||||
XT_COLOR_CELL* GetCellFromIndex(int iIndex);
|
||||
|
||||
// Input: cxLeft - Specifies the left position.
|
||||
// cyTop - Specifies the top.
|
||||
// cxRight - Specifies the right.
|
||||
// cyBottom - Specifies the bottom.
|
||||
// Summary: This member function is called to set the size of the borders
|
||||
// for the control.
|
||||
void SetBorders(int cxLeft = 0, int cyTop = 0, int cxRight = 0, int cyBottom = 0);
|
||||
|
||||
protected:
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// Summary: This member function is called to draw the color selector.
|
||||
void DrawColorSelector(CDC* pDC);
|
||||
|
||||
// Input: pColorCell - An XT_COLOR_CELL object.
|
||||
// pDC - A CDC pointer that represents the current device context.
|
||||
// bHilite - TRUE to highlight the color cell.
|
||||
// bPressed - TRUE to press the color cell.
|
||||
// Summary: This member function is called to draw the cell specified by 'pColorCell'.
|
||||
void DrawColorCell(XT_COLOR_CELL* pColorCell, CDC* pDC, BOOL bHilite, BOOL bPressed);
|
||||
|
||||
// Input: nCurSel - Current index of the selected color box or button
|
||||
// in the color popup window.
|
||||
// Summary: This member function will finish the selection process for the color
|
||||
// box or button in the color popup window.
|
||||
virtual void EndSelection(int nCurSel);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTColorSelectorCtrl)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
protected:
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
void _EndSelection(int nCurSel, LPARAM callerParam);
|
||||
|
||||
protected:
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTColorSelectorCtrl)
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnMouseLeave();
|
||||
afx_msg UINT OnNcHitTest(CPoint point);
|
||||
//}}AFX_MSG
|
||||
|
||||
friend class CXTPopupColorTearOff;
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTColorSelectorCtrl::SetBorders(int cxLeft, int cyTop, int cxRight, int cyBottom) {
|
||||
m_rcBorders.left = cxLeft; m_rcBorders.top = cyTop; m_rcBorders.right = cxRight; m_rcBorders.bottom = cyBottom;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif //__XTCOLORCTRL_H__
|
||||
215
Editor/XT/Include/XTComboBoxEx.h
Normal file
215
Editor/XT/Include/XTComboBoxEx.h
Normal file
@@ -0,0 +1,215 @@
|
||||
// XTComboBoxEx.h : interface for the CXTComboBoxEx class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTCOMBOBOXEX_H__)
|
||||
#define __XTCOMBOBOXEX_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: The CXTComboBoxEx class is a CComboBox derived class. It extends the
|
||||
// combo box control by providing support for image lists. By using CXTComboBoxEx
|
||||
// to create combo box controls, you no longer need to implement your own
|
||||
// image drawing code. Instead, use CXTComboBoxEx to access images from
|
||||
// an image list.
|
||||
class _XT_EXT_CLASS CXTComboBoxEx : public CComboBox
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTComboBoxEx)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTComboBoxEx object.
|
||||
CXTComboBoxEx();
|
||||
|
||||
// Summary: Destroys a CXTComboBoxEx object, handles cleanup and de-allocation.
|
||||
virtual ~CXTComboBoxEx();
|
||||
|
||||
// Input: dwStyle - Specifies the combination of combo box styles applied to the
|
||||
// combo box.
|
||||
// rect - A reference to a CRect object or RECT structure that specifies
|
||||
// the position and size of the combo box.
|
||||
// pParentWnd - A pointer to a CWnd object that is the parent window of the
|
||||
// combo box (usually a CDialog). It must <b>not</b> be NULL.
|
||||
// nID - Specifies the combo box<6F>s control ID.
|
||||
// Returns: Nonzero if the operation was successful, otherwise returns zero.
|
||||
// Summary: This member function creates the combo box and attaches it to the
|
||||
// CXTComboBoxEx object.
|
||||
BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
|
||||
|
||||
#if _MFC_VER >= 0x0700 //MFC 7.0
|
||||
using CComboBox::DeleteItem;
|
||||
#endif //MFC 7.0
|
||||
|
||||
// Input: iIndex - Zero-based index of the item to be removed.
|
||||
// Returns: The number of items remaining in the control. If 'iIndex' is
|
||||
// invalid, the function returns CB_ERR.
|
||||
// Summary: This member function removes an item from a ComboBoxEx control.
|
||||
int DeleteItem(int iIndex);
|
||||
|
||||
// Input: pCBItem - A pointer to a COMBOBOXEXITEM structure that will receive the
|
||||
// item information.
|
||||
// Returns: Nonzero if the operation was successful, otherwise returns zero.
|
||||
// Summary: This member function retrieves item information for a given ComboBoxEx item.
|
||||
BOOL GetItem(COMBOBOXEXITEM* pCBItem);
|
||||
|
||||
// Input: pCBItem - A pointer to a COMBOBOXEXITEM structure that will receive the
|
||||
// item information. This structure contains callback flag values for the item.
|
||||
// Returns: The index at which the new item was inserted if successful,
|
||||
// otherwise returns -1.
|
||||
// Summary: This member function inserts a new item in a ComboBoxEx control.
|
||||
int InsertItem(const COMBOBOXEXITEM* pCBItem);
|
||||
|
||||
// Input: iItem - Item index.
|
||||
// nStringID - String resource.
|
||||
// iIndent - Amount, in pixels, image is to be indented.
|
||||
// iImage - Image index.
|
||||
// iSelectedImage - Selected image index.
|
||||
// mask - Style mask.
|
||||
// Returns: The index at which the new item was inserted if successful,
|
||||
// otherwise returns -1.
|
||||
// Summary: This member function inserts a new item in a ComboBoxEx control.
|
||||
int InsertItem(int iItem, UINT nStringID, int iIndent=0, int iImage=0, int iSelectedImage=0, UINT mask=CBEIF_TEXT|CBEIF_IMAGE|CBEIF_SELECTEDIMAGE|CBEIF_INDENT);
|
||||
|
||||
// Input: iItem - Item index.
|
||||
// lpszItem - Item string.
|
||||
// iIndent - Amount, in pixels, image is to be indented.
|
||||
// iImage - Image index.
|
||||
// iSelectedImage - Selected image index.
|
||||
// mask - Style mask.
|
||||
// Returns: The index at which the new item was inserted if successful,
|
||||
// otherwise returns -1.
|
||||
// Summary: This member function inserts a new item in a ComboBoxEx control.
|
||||
int InsertItem(int iItem, LPCTSTR lpszItem, int iIndent=0, int iImage=0, int iSelectedImage=0, UINT mask=CBEIF_TEXT|CBEIF_IMAGE|CBEIF_SELECTEDIMAGE|CBEIF_INDENT);
|
||||
|
||||
// Input: pCBItem - A pointer to a COMBOBOXEXITEM structure that will receive the
|
||||
// item information.
|
||||
// Returns: Nonzero if the operation was successful, otherwise returns zero.
|
||||
// Summary: This member function sets the attributes for an item in a ComboBoxEx control.
|
||||
BOOL SetItem(const COMBOBOXEXITEM* pCBItem);
|
||||
|
||||
// Returns: The DWORD value that contains the extended styles that are used for
|
||||
// the combo box control.
|
||||
// Summary: This member function retrieves the extended styles control.
|
||||
DWORD GetExtendedStyle() const;
|
||||
|
||||
// Input: dwExMask - A DWORD value that indicates which styles in 'dwExStyles' are
|
||||
// to be affected. Only the extended styles in 'dwExMask' will be changed.
|
||||
// All other styles will be maintained as is. If this parameter is zero,
|
||||
// then all of the styles in 'dwExStyles' will be affected.
|
||||
// dwExStyles - A DWORD value that contains the combo box control extended styles
|
||||
// to set for the control.
|
||||
// Summary: This member function sets extended styles within a combo box control.
|
||||
// Returns: A DWORD value that contains the extended styles previously
|
||||
// used for the control.
|
||||
DWORD SetExtendedStyle(DWORD dwExMask, DWORD dwExStyles);
|
||||
|
||||
// Returns: Nonzero if the user has typed in the control's edit box, otherwise
|
||||
// returns zero.
|
||||
// Summary: This member function is used to determine if the text in the combo
|
||||
// has changed by typing.
|
||||
BOOL HasEditChanged();
|
||||
|
||||
// Returns: A pointer to a CEdit object.
|
||||
// Summary: Call this member function to get a pointer to the edit control for
|
||||
// a combo box.
|
||||
CEdit* GetEditCtrl();
|
||||
|
||||
// Returns: A pointer to a CComboBox object.
|
||||
// Summary: Call this member function to get a pointer to a combo box control
|
||||
// within a CXTComboBoxEx object.
|
||||
CComboBox* GetComboBoxCtrl();
|
||||
|
||||
// Returns: A pointer to a CImageList object. If it fails, this member function
|
||||
// returns NULL.
|
||||
// Summary: Call this member function to retrieve a pointer to the image list
|
||||
// used by a CXTComboBoxEx control.
|
||||
CImageList* GetImageList() const;
|
||||
|
||||
// Input: pImageList - A pointer to a CImageList object containing the images to use
|
||||
// with the CXTComboBoxEx control.
|
||||
// Returns: A pointer to a CImageList object containing the images previously used by
|
||||
// the CXTComboBoxEx control. Returns NULL if no image list was previously set.
|
||||
// Summary: Sets an image list for a ComboBoxEx control.
|
||||
CImageList* SetImageList(CImageList* pImageList);
|
||||
|
||||
// Un-supported base class message.
|
||||
int Dir(UINT attr, LPCTSTR lpszWildCard);
|
||||
|
||||
// Un-supported base class message.
|
||||
int FindString(int nIndexStart, LPCTSTR lpszFind) const;
|
||||
|
||||
// Un-supported base class message.
|
||||
int AddString(LPCTSTR lpszString);
|
||||
|
||||
// Un-supported base class message.
|
||||
BOOL SetEditSel(int nStartChar, int nEndChar);
|
||||
|
||||
// Un-supported base class message.
|
||||
int InsertString(int nIndex, LPCTSTR lpszString);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE CXTComboBoxEx::CXTComboBoxEx() {
|
||||
|
||||
}
|
||||
AFX_INLINE DWORD CXTComboBoxEx::GetExtendedStyle() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, CBEM_GETEXTENDEDSTYLE, 0, 0);
|
||||
}
|
||||
AFX_INLINE DWORD CXTComboBoxEx::SetExtendedStyle(DWORD dwExMask, DWORD dwExStyles) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, CBEM_SETEXTENDEDSTYLE, (DWORD) dwExMask, (LPARAM) dwExStyles);
|
||||
}
|
||||
AFX_INLINE BOOL CXTComboBoxEx::HasEditChanged() {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, CBEM_HASEDITCHANGED, 0, 0);
|
||||
}
|
||||
AFX_INLINE CEdit* CXTComboBoxEx::GetEditCtrl() {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (CEdit*) CEdit::FromHandle((HWND) ::SendMessage(m_hWnd, CBEM_GETEDITCONTROL, 0, 0));
|
||||
}
|
||||
AFX_INLINE CComboBox* CXTComboBoxEx::GetComboBoxCtrl() {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (CComboBox*) CComboBox::FromHandle((HWND) ::SendMessage(m_hWnd, CBEM_GETCOMBOCONTROL, 0, 0));
|
||||
}
|
||||
AFX_INLINE CImageList* CXTComboBoxEx::SetImageList(CImageList* pImageList) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, CBEM_SETIMAGELIST, 0, (LPARAM)pImageList->GetSafeHandle()));
|
||||
}
|
||||
AFX_INLINE CImageList* CXTComboBoxEx::GetImageList() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, CBEM_GETIMAGELIST, 0, 0));
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// While CXTComboBoxEx derives from CComboBox, there are some
|
||||
// CB_messages the underlying ComboBoxEx control doesn't support.
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
AFX_INLINE int CXTComboBoxEx::Dir(UINT attr, LPCTSTR lpszWildCard) {
|
||||
UNUSED_ALWAYS(attr); UNUSED_ALWAYS(lpszWildCard); ASSERT(FALSE); return CB_ERR;
|
||||
}
|
||||
AFX_INLINE int CXTComboBoxEx::FindString(int nIndexStart, LPCTSTR lpszFind) const {
|
||||
UNUSED_ALWAYS(nIndexStart); UNUSED_ALWAYS(lpszFind); ASSERT(FALSE); return CB_ERR;
|
||||
}
|
||||
AFX_INLINE int CXTComboBoxEx::AddString(LPCTSTR lpszString) {
|
||||
UNUSED_ALWAYS(lpszString); ASSERT(FALSE); return CB_ERR;
|
||||
}
|
||||
AFX_INLINE BOOL CXTComboBoxEx::SetEditSel(int nStartChar, int nEndChar) {
|
||||
UNUSED_ALWAYS(nStartChar); UNUSED_ALWAYS(nEndChar); ASSERT(FALSE); return FALSE;
|
||||
}
|
||||
AFX_INLINE int CXTComboBoxEx::InsertString(int nIndex, LPCTSTR lpszString) {
|
||||
UNUSED_ALWAYS(nIndex); UNUSED_ALWAYS(lpszString); ASSERT(FALSE); return CB_ERR;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTCOMBOBOXEX_H__)
|
||||
103
Editor/XT/Include/XTCommandsListBox.h
Normal file
103
Editor/XT/Include/XTCommandsListBox.h
Normal file
@@ -0,0 +1,103 @@
|
||||
// XTCommandsListBox.h : interface for the CXTCommandsListBox class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTCOMMANDSLISTBOX_H__)
|
||||
#define __XTCOMMANDSLISTBOX_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
class CXTCustomGroupItemInfo;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTCommandsListBox is a CListBox derived class. It is used during toolbar
|
||||
// customization to display a list of currently available commands.
|
||||
class _XT_EXT_CLASS CXTCommandsListBox : public CListBox
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
// Summary: This object site API.
|
||||
interface ISite
|
||||
{
|
||||
// Input: nCmdID - Command ID whose icon is queried for.
|
||||
// hIcon - destination to store command icon, valid if function returns true
|
||||
// hDisabledIcon - destination to store disabled command icon, can be NULL,
|
||||
// valid if function returns true
|
||||
// hHotIcon - destination to store the hot command icon, can be NULL, valid if the
|
||||
// function returns true.
|
||||
// Returns: true if found, false otherwise
|
||||
// Summary: This member function gets a command icon.
|
||||
virtual bool GetCommandIcon(UINT nCmdID,HICON& hIcon, HICON& hDisabledIcon,HICON& hHotIcon) = 0;
|
||||
|
||||
// Input: pos - Position (item data) of the item in the list box.
|
||||
// Returns: A UINT object.
|
||||
// Summary: This member function gets command ID by its position.
|
||||
virtual UINT GetItemCommand(int pos) = 0;
|
||||
|
||||
// Input: pos - Position (item data) of the item in the list box.
|
||||
// Summary: This member function performs a drag and drop of an item at the position
|
||||
// provided.
|
||||
virtual void DragNDrop(int pos) = 0;
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
CSize m_sizeIcon;
|
||||
ISite* const m_site;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
ISite* GetSite() const {
|
||||
return m_site;
|
||||
}
|
||||
CSize& GetIconSize() {
|
||||
return m_sizeIcon;
|
||||
}
|
||||
|
||||
// Input: site - Points to an ISite object.
|
||||
// Summary: Constructs a CXTCommandsListBox object.
|
||||
CXTCommandsListBox(ISite* site);
|
||||
|
||||
// Summary: Destroys a CXTCommandsListBox object, handles cleanup and de-allocation.
|
||||
virtual ~CXTCommandsListBox();
|
||||
|
||||
public:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTCommandsListBox)
|
||||
public:
|
||||
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
|
||||
virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTCommandsListBox)
|
||||
afx_msg void OnPaint();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTCOMMANDSLISTBOX_H__)
|
||||
503
Editor/XT/Include/XTControlBar.h
Normal file
503
Editor/XT/Include/XTControlBar.h
Normal file
@@ -0,0 +1,503 @@
|
||||
// XTControlBar.h : interface for the CXTControlBar class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTCONTROLBAR_H__)
|
||||
#define __XTCONTROLBAR_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
// Forwards
|
||||
|
||||
class CXTControlBar;
|
||||
class CXTDockWindow;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTDockContextWndHook is a CXTWndHook derived class. It listens to
|
||||
// the relevant messages the parent frame receives.
|
||||
class CXTDockContextWndHook : public CXTWndHook
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTDockContextWndHook)
|
||||
|
||||
CXTControlBar* m_pBar;
|
||||
|
||||
public:
|
||||
// Summary: Constructs a CXTDockContextWndHook object.
|
||||
CXTDockContextWndHook(
|
||||
CXTControlBar* pBar)
|
||||
: m_pBar(pBar)
|
||||
{ }
|
||||
|
||||
virtual LRESULT WindowProc(
|
||||
UINT message,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam);
|
||||
};
|
||||
|
||||
// Summary: XT_BARPLACEMENT is a stand alone helper structure class. It is used
|
||||
// by CXTControlBar to save and restore the control bar's size, location,
|
||||
// and style.
|
||||
struct XT_BARPLACEMENT
|
||||
{
|
||||
BOOL bUnique; // TRUE if the control bar is the only one docked in a row or column.
|
||||
BOOL bMaximized; // TRUE if the control bar is maximized.
|
||||
CSize sizeVert; // Vertical size of the control bar.
|
||||
CSize sizeHorz; // Horizontal size of the control bar.
|
||||
CSize sizeFloat; // Floating size of the control bar.
|
||||
CSize sizeDefault; // Default size the control bar should be.
|
||||
DWORD dwStyle; // Control bar style flags.
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTControlBar is a CControlBar derived class. It is the base class
|
||||
// for the control bar classes CXTStatusBar, CXTToolBar, CXTDialogBar and
|
||||
// CXTReBar. A control bar is a window that is usually aligned to the left
|
||||
// or right of a frame window. It may contain child items that are either
|
||||
// HWND-based controls, which are Windows windows that generate and respond
|
||||
// to Windows messages, or non-HWND-based items, which are not windows
|
||||
// and are managed by application code or framework code. List boxes and
|
||||
// edit controls are examples of HWND-based controls; status-bar panes
|
||||
// and bitmap buttons are examples of non-HWND-based controls.
|
||||
//
|
||||
// Control bar windows are usually child windows of a parent frame window
|
||||
// and are usually siblings to the client view or MDI client of the frame
|
||||
// window. A CXTControlBar object uses information about the parent window<6F>s
|
||||
// client rectangle to position itself. It then informs the parent window
|
||||
// as to how much space remains unallocated in the parent window<6F>s client
|
||||
// area.
|
||||
class _XT_EXT_CLASS CXTControlBar : public CControlBar
|
||||
{
|
||||
friend CXTDockContextWndHook;
|
||||
|
||||
DECLARE_DYNAMIC(CXTControlBar)
|
||||
|
||||
public:
|
||||
// Summary: A delegate to notify when visibility of this control bar changes.
|
||||
typedef CXTMultiCastDelegate1<bool> NOTEBARVISIBLE;
|
||||
NOTEBARVISIBLE NoteBarVisible;
|
||||
|
||||
protected:
|
||||
|
||||
// Summary: Constructs a CXTControlBar object.
|
||||
CXTControlBar();
|
||||
|
||||
// Input: lpRect - Pointer to a RECT structure that represents the border size.
|
||||
// Summary: This member function is called to set the size of the borders
|
||||
// for the control bar.
|
||||
virtual void SetBorders(LPCRECT lpRect);
|
||||
|
||||
// Input: cxLeft - Specifies the left position.
|
||||
// cyTop - Specifies the top.
|
||||
// cxRight - Specifies the right.
|
||||
// cyBottom - Specifies the bottom.
|
||||
// Summary: This member function is called to set the size of the borders
|
||||
// for the control bar.
|
||||
virtual void SetBorders(int cxLeft = 0, int cyTop = 0, int cxRight = 0, int cyBottom = 0);
|
||||
|
||||
|
||||
// Returns: A CRect object.
|
||||
// Summary: This member function is called to return the size of the control
|
||||
// bar's borders.
|
||||
virtual CRect GetBorders() const;
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
XT_BARPLACEMENT m_bp; // Placement struct to hold size and style information.
|
||||
|
||||
private:
|
||||
CFrameWnd* m_pOriginalFrame;
|
||||
CXTDockContextWndHook* m_pHook;
|
||||
CXTDockContextWndHook* m_pHookParent;
|
||||
protected:
|
||||
|
||||
int m_nPos; // Index of the popup menu contained in the menu.
|
||||
UINT m_menuID; // Popup menu resource ID.
|
||||
bool m_bInReBar; // true if the parent is a rebar.
|
||||
bool m_bContextMenus; // true to display context menus for control bars.
|
||||
CFont m_font; // 8pt control bar font.
|
||||
CFont m_fontVert; // 8pt vert control bar font.
|
||||
CFont m_fontBold; // 8pt bold control bar font.
|
||||
|
||||
private:
|
||||
|
||||
bool m_bEnableMultiFrameDocking;
|
||||
|
||||
public:
|
||||
|
||||
// Input: bEnable - true to enable context menus. false to disable.
|
||||
// Summary: This member function is called to enable or disable context menus for
|
||||
// the control bar.
|
||||
void EnableContextMenus(bool bEnable);
|
||||
|
||||
// Returns: true if context menus are enabled, otherwise returns false.
|
||||
// Summary: Call this member function to determine if the control bar has context
|
||||
// menus enabled.
|
||||
bool HasContextMenu();
|
||||
|
||||
// Returns: true if the control is nested inside of a rebar.
|
||||
// Summary: This member function is called to determine if the control bar is nested
|
||||
// inside of a CXTReBar object.
|
||||
bool InRebar() const;
|
||||
|
||||
// Summary: Destroys a CXTControlBar object, handles cleanup and de-allocation.
|
||||
virtual ~CXTControlBar();
|
||||
|
||||
// Returns: The current CBRS_XT_ (control bar) settings for the control bar.
|
||||
// See ModifyXTBarStyle for the complete list of available styles.
|
||||
// Summary: Call this member function to determine which CBRS_XT_ (control bar)
|
||||
// settings are currently set for the control bar. It does not
|
||||
// handle WS_ (window style) or CBRS_ (control bar style).
|
||||
virtual DWORD GetXTBarStyle();
|
||||
|
||||
// Input: dwStyle - New CBRS_XT_ style for the control bar, see ModifyXTBarStyle()
|
||||
// for available styles.
|
||||
// Summary: This member function will set the style for the control bar. It does not
|
||||
// handle WS_ (window style) or CBRS_ (control bar style).
|
||||
virtual void SetXTBarStyle(DWORD dwStyle);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwRemove - Specifies CBRS_XT_ styles to be removed during style
|
||||
// modification.
|
||||
// dwAdd - Specifies CBRS_XT_ styles to be added during style
|
||||
// modification.
|
||||
// bRedraw - The desired styles for the control bar can be one or more of
|
||||
// the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_XT_BUTTONS</b> The control bar has a minimize and
|
||||
// close button when docked.[/li]
|
||||
// [li]<b>CBRS_XT_GRIPPER</b> The control bar has a gripper when
|
||||
// docked.[/li]
|
||||
// [li]<b>CBRS_XT_GRIPPER_FLAT</b> The control bar has a flat
|
||||
// gripper. Use with CBRS_XT_GRIPPER.[/li]
|
||||
// [li]<b>CBRS_XT_GRIPPER_GRAD</b> The control bar has a gradient
|
||||
// flat gripper. Use with CBRS_XT_GRIPPER_FLAT.[/li]
|
||||
// [li]<b>CBRS_XT_GRIPPER_TEXT</b> The control bar draws text
|
||||
// in the gripper area. Use with CBRS_XT_GRIPPER.[/li]
|
||||
// [li]<b>CBRS_XT_BUTTONS_FLAT</b> The control bar min and max
|
||||
// buttons are flat. Use with CBRS_XT_BUTTONS.[/li]
|
||||
// [li]<b>CBRS_XT_BORDERS_FLAT</b> The control bar borders are flat.[/li]
|
||||
// [li]<b>CBRS_XT_CLIENT_OUTLINE</b> Draw a single black border
|
||||
// outline around the client area.[/li]
|
||||
// [li]<b>CBRS_XT_CLIENT_STATIC</b> Draw a static rect around
|
||||
// the client area.[/li]
|
||||
// [li]<b>CBRS_XT_CLIENT_MODAL</b> Draw a modal rect around the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_XT_ALL_FLAT</b> The following styles combined by
|
||||
// using the bitwise OR (|) operator; CBRS_XT_GRIPPER_FLAT,
|
||||
// CBRS_XT_BUTTONS_FLAT and CBRS_XT_BORDERS_FLAT.[/li]
|
||||
// [li]<b>CBRS_XT_DEFAULT</b> The following styles combined by
|
||||
// using the bitwise OR (|) operator; CBRS_XT_BUTTONS,
|
||||
// CBRS_XT_GRIPPER, CBRS_XT_GRIPPER_TEXT.[/li]
|
||||
// [/ul]
|
||||
// Returns: Nonzero if the style was successfully modified, otherwise returns zero.
|
||||
// Summary: Call this member function to modify a control bar style. Styles to
|
||||
// be added or removed can be combined by using the bitwise OR (|)
|
||||
// operator.
|
||||
virtual BOOL ModifyXTBarStyle(DWORD dwRemove,DWORD dwAdd,BOOL bRedraw=TRUE);
|
||||
|
||||
// Input: menuID - Resource ID of the menu to be used.
|
||||
// nPos - Zero-based index of the popup menu located in the
|
||||
// menu resource. For example IDR_MAINFRAME's "File"
|
||||
// popup menu would be 0.
|
||||
// Summary: This member function is used to set the resource ID for the
|
||||
// popup menu associated with the control bar.
|
||||
virtual void SetMenuID(UINT menuID,int nPos=0);
|
||||
|
||||
// Returns: A UNIT value that represents the popup menu ID associated
|
||||
// with the control bar.
|
||||
// Summary: This member function retrieves the resource ID of the popup menu.
|
||||
virtual UINT GetMenuID();
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// Summary: This member function is called by the control bar to perform paint
|
||||
// operations.
|
||||
virtual void DoPaint(CDC* pDC);
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// rect - A CRect reference that represents the size of the gripper to draw.
|
||||
// Summary: This member function is called to draw the gripper for the control bar.
|
||||
virtual void DrawGripper(CDC* pDC, const CRect& rect);
|
||||
|
||||
// Input: pDC - A CDC pointer that represents the current device context.
|
||||
// rect - A CRect reference that represents the border area to draw.
|
||||
// Summary: This member function is called to draw the borders for the control bar.
|
||||
virtual void DrawBorders(CDC* pDC, CRect& rect);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwDockStyle - Specifies whether the control bar supports docking and the sides of
|
||||
// its parent window to which the control bar can be docked, if supported.
|
||||
// It can be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_ALIGN_TOP</b> Allows docking at the top of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_BOTTOM</b> Allows docking at the bottom of
|
||||
// the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_LEFT</b> Allows docking on the left side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_RIGHT</b> Allows docking on the right side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_ANY</b> Allows docking on any side of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_FLOAT_MULTI</b> Allows multiple control bars to
|
||||
// be floated in a single mini-frame window.[/li]
|
||||
// [/ul]
|
||||
// If 0 (that is, indicating no flags), the control
|
||||
// bar will not dock.
|
||||
// Summary: Call this member function to enable a control bar to be docked.
|
||||
// The sides specified must match one of the sides enabled for
|
||||
// docking in the destination frame window, or the control bar
|
||||
// cannot be docked to that frame window.
|
||||
void EnableDocking(DWORD dwDockStyle);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwDockStyle - Specifies whether the control bar supports
|
||||
// docking and the sides of its parent window to
|
||||
// which the control bar can be docked, if supported.
|
||||
// It can be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_ALIGN_TOP</b> Allows docking at the top of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_BOTTOM</b> Allows docking at the bottom of
|
||||
// the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_LEFT</b> Allows docking on the left side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_RIGHT</b> Allows docking on the right side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_ANY</b> Allows docking on any side of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_FLOAT_MULTI</b> Allows multiple control bars to
|
||||
// be floated in a single mini-frame window.[/li]
|
||||
// [/ul]
|
||||
// If 0 (that is, indicating no flags), the control
|
||||
// bar will not dock.
|
||||
// dwFlatStyle - Specifies the splitter's, inside dockbars, look.
|
||||
// It can be one of the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_XT_NONFLAT</b> Thick devstudio like non-flat
|
||||
// splitters.[/li]
|
||||
// [li]<b>CBRS_XT_SEMIFLAT</b> Thin 3D non-flat splitters.[/li]
|
||||
// [li]<b>CBRS_XT_FLAT</b> Flat splitters.[/li]
|
||||
// [/ul]
|
||||
// Summary: Call this member function to enable a control bar to be docked.
|
||||
// The sides specified must match one of the sides enabled for
|
||||
// docking in the destination frame window, or the control bar
|
||||
// cannot be docked to that frame window.
|
||||
void EnableDockingEx(DWORD dwDockStyle, DWORD dwFlatStyle);
|
||||
|
||||
// Returns: Nonzero if it is docked on the left side, otherwise returns zero.
|
||||
// Summary: This member function is used to determine if the control bar
|
||||
// is docked on the left side.
|
||||
virtual BOOL IsLeftDocked() const;
|
||||
|
||||
// Returns: Nonzero if it is docked on the right side, otherwise returns zero.
|
||||
// Summary: This member function is used to determine if the control bar
|
||||
// is docked on the right side.
|
||||
virtual BOOL IsRightDocked() const;
|
||||
|
||||
// Returns: Nonzero if it is docked on the top side, otherwise returns zero.
|
||||
// Summary: This member function is used to determine if the control bar
|
||||
// is docked on the top side.
|
||||
virtual BOOL IsTopDocked() const;
|
||||
|
||||
// Returns: Nonzero if it is docked on the bottom side, otherwise returns zero.
|
||||
// Summary: This member function is used to determine if the control bar
|
||||
// is docked on the bottom side.
|
||||
virtual BOOL IsBottomDocked() const;
|
||||
|
||||
// Returns: Nonzero if it is docked on the top or bottom side, otherwise returns zero.
|
||||
// Summary: This member function is used to determine if the control bar
|
||||
// is docked on the top or bottom side.
|
||||
virtual BOOL IsHorzDocked() const;
|
||||
|
||||
// Returns: Nonzero if it is docked on the left or right side, otherwise returns zero.
|
||||
// Summary: This member function is used to determine if the control bar
|
||||
// is docked on the left or right side.
|
||||
virtual BOOL IsVertDocked() const;
|
||||
|
||||
// Returns: Nonzero if it is floating, otherwise returns 0.
|
||||
// Summary: This member function is used to determine if the control bar
|
||||
// is docked or floating.
|
||||
virtual BOOL IsFloating() const;
|
||||
|
||||
// Returns: An RGB color value.
|
||||
// Summary: This member function is used to determine the correct background fill
|
||||
// color to be used during paint operations.
|
||||
virtual COLORREF GetBackgroundColor() const;
|
||||
|
||||
// Input: bEnable - Tells if this feature is turned on. Set this parameter to true
|
||||
// to allow this control bar to be docked to all CFrameWnd's descendants
|
||||
// that have issued EnableDocking().
|
||||
// Summary: Enables or disables redocking of this control bar. You can also override
|
||||
// CanDock() for precisely controlling which control bar can be docked
|
||||
// to what frame window. By default, this feature is turned off, and should
|
||||
// be enabled <b>before</b> you actually create the control bar.
|
||||
void EnableMultiFrameDocking(bool bEnable = true);
|
||||
|
||||
// Input: pFrame - The frame this control bar will be redocked to.
|
||||
// Returns: true if it is allowed to dock, otherwise returns false.
|
||||
// Summary: Tells if this control bar is allowed to dock to a specific frame.
|
||||
virtual bool CanDock(CFrameWnd* pFrame);
|
||||
|
||||
// Input: pRBBI - Pointer to a rebar bar descriptor to use to fill in the sizing
|
||||
// information.
|
||||
// bHorz - true if the control bar is horizontally oriented.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This notification is called whenever this control bar is added to a
|
||||
// CXTReBar object. Default implementation sizes the rebar bar such that
|
||||
// it fully displays this control bar.
|
||||
virtual bool OnAddedToRebar(REBARBANDINFO* pRBBI, bool bHorz);
|
||||
|
||||
// Input: pInfo - Descriptor of the band that contains this control bar.
|
||||
// bHorz - Tells if it is horizontally oriented.
|
||||
// Summary: This member function is called whenever this control bar is embedded
|
||||
// in a CXTReBar control that has just resized the band in which this
|
||||
// control resides. Default implementation does nothing.
|
||||
virtual void OnRebarBandResized(XT_REBARSIZECHILDINFO* pInfo, bool bHorz);
|
||||
|
||||
// Returns: true to enable full window drag, or false to use the wire frame.
|
||||
// Summary: This member function tells if this control bar shall be visualized
|
||||
// when dragging or the system shall render it with a wire frame. Default
|
||||
// implementation uses a wire frame.
|
||||
virtual bool IsFullWindowDrag();
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: pSize -
|
||||
// [ul]
|
||||
// [li]<b>IN</b> Extent of the rectangle in which the hot spot must be defined.[/li]
|
||||
// [li]<b>OUT</b> Offset of the hot spot from the rect's top-left corner.[/li]
|
||||
// [/ul]
|
||||
// Summary: This member function calculates the position of the control bar hot
|
||||
// spot, i.e. the point that is used to pin the control bar rect to the
|
||||
// mouse cursor when dragging it. Returns true if the menu bar defines
|
||||
// a hot spot. In which case, a buffer pointed to by 'pSize' is filled
|
||||
// with the hot spot offset from the top-left corner. Returns false
|
||||
// to indicate that no hot spot is defined (the default).
|
||||
virtual bool GetHotSpot(LPSIZE pSize);
|
||||
|
||||
// Returns: A pointer to a dialog window if successful; otherwise NULL.
|
||||
// Summary: Call this member function to retrieve the parent dialog window. The
|
||||
// member function searches up the parent chain until a CDialog (or
|
||||
// derived class) object is found.
|
||||
CDialog* GetParentDialog() const;
|
||||
|
||||
// Returns: A pointer to a docking window if successful; otherwise NULL.
|
||||
// Summary: Call this member function to retrieve the parent docking window. The
|
||||
// member function searches up the parent chain until a CXTDockWindow (or
|
||||
// derived class) object is found.
|
||||
CXTDockWindow* GetParentDockWnd() const;
|
||||
|
||||
public:
|
||||
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValidCtrlID(bool bCheckUnique = true);
|
||||
static void AssertValidCtrlID(CControlBar *pBar, bool bCheckUnique = true);
|
||||
#endif //_DEBUG
|
||||
virtual void DockTrackingDone();
|
||||
virtual void UpdateControlBarFonts();
|
||||
virtual bool ShowMoveCursor() const;
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTControlBar)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual BOOL OnPopupMenu(CPoint& point, CFrameWnd* pFrameWnd);
|
||||
virtual LRESULT WindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam);
|
||||
virtual void CalcInsideRect(CRect& rect, BOOL bHorz) const;
|
||||
virtual void EraseNonClient();
|
||||
virtual BOOL SetStatusText(int nHit);
|
||||
virtual void DelayShow(BOOL bShow);
|
||||
virtual bool HasCmdHandlers(CWnd* pWnd);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTControlBar)
|
||||
afx_msg void OnWindowPosChanging(LPWINDOWPOS lpWndPos);
|
||||
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnNcPaint();
|
||||
afx_msg void OnPaint();
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg LRESULT OnIdleUpdateCmdUI (WPARAM wParam, LPARAM lParam);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnAddRebar(WPARAM wp, LPARAM lp);
|
||||
afx_msg LRESULT OnRebarSizeChild(WPARAM wp, LPARAM lp);
|
||||
afx_msg LRESULT OnQueryVisualize(WPARAM wp, LPARAM lp);
|
||||
afx_msg LRESULT OnDragTrackingDone(WPARAM wp, LPARAM lp);
|
||||
afx_msg LRESULT OnQueryHotSpot(WPARAM wp, LPARAM lp);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
friend class CXTReBar;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE bool CXTControlBar::InRebar() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return m_bInReBar;
|
||||
}
|
||||
AFX_INLINE void CXTControlBar::SetBorders(LPCRECT lpRect) {
|
||||
/*ASSERT(::IsWindow(m_hWnd));*/ SetBorders(lpRect->left, lpRect->top, lpRect->right, lpRect->bottom);
|
||||
}
|
||||
AFX_INLINE CRect CXTControlBar::GetBorders() const {
|
||||
/*ASSERT(::IsWindow(m_hWnd));*/ return CRect(m_cxLeftBorder, m_cyTopBorder, m_cxRightBorder, m_cyBottomBorder);
|
||||
}
|
||||
AFX_INLINE UINT CXTControlBar::GetMenuID() {
|
||||
/*ASSERT(::IsWindow(m_hWnd));*/ return m_menuID;
|
||||
}
|
||||
AFX_INLINE void CXTControlBar::SetMenuID(UINT menuID, int nPos) {
|
||||
/*ASSERT(::IsWindow(m_hWnd));*/ m_menuID=menuID; m_nPos=nPos;
|
||||
}
|
||||
AFX_INLINE BOOL CXTControlBar::IsVertDocked() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (IsLeftDocked() || IsRightDocked());
|
||||
}
|
||||
AFX_INLINE BOOL CXTControlBar::IsHorzDocked() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (IsTopDocked() || IsBottomDocked());
|
||||
}
|
||||
AFX_INLINE BOOL CXTControlBar::IsBottomDocked() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (GetParent()->GetDlgCtrlID()==AFX_IDW_DOCKBAR_BOTTOM);
|
||||
}
|
||||
AFX_INLINE BOOL CXTControlBar::IsTopDocked() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (GetParent()->GetDlgCtrlID()==AFX_IDW_DOCKBAR_TOP);
|
||||
}
|
||||
AFX_INLINE BOOL CXTControlBar::IsRightDocked() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (GetParent()->GetDlgCtrlID()==AFX_IDW_DOCKBAR_RIGHT);
|
||||
}
|
||||
AFX_INLINE BOOL CXTControlBar::IsLeftDocked() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (GetParent()->GetDlgCtrlID()==AFX_IDW_DOCKBAR_LEFT);
|
||||
}
|
||||
AFX_INLINE BOOL CXTControlBar::IsFloating() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (!IsHorzDocked() && !IsVertDocked());
|
||||
}
|
||||
AFX_INLINE void CXTControlBar::EnableContextMenus(bool bEnable) {
|
||||
m_bContextMenus = bEnable;
|
||||
}
|
||||
AFX_INLINE bool CXTControlBar::HasContextMenu() {
|
||||
if (!xtAfxData.bControlBarMenus) return false; return m_bContextMenus;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTCONTROLBAR_H__)
|
||||
582
Editor/XT/Include/XTCoolMenu.h
Normal file
582
Editor/XT/Include/XTCoolMenu.h
Normal file
@@ -0,0 +1,582 @@
|
||||
// XTCoolMenu.h : interface for the CXTCoolMenu class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTCOOLMENU_H__)
|
||||
#define __XTCOOLMENU_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTItemData is a stand alone helper class. It is used by CXTCoolMenu.
|
||||
class _XT_EXT_CLASS CXTItemData
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTItemData object.
|
||||
CXTItemData ();
|
||||
|
||||
// Summary: Destroys a CXTItemData object, handles cleanup and de-allocation.
|
||||
virtual ~CXTItemData();
|
||||
|
||||
long m_itemID; // Unique identifying number.
|
||||
UINT m_nPosition; // Menu item position.
|
||||
UINT m_commandID; // Menu item (command) ID.
|
||||
BOOL m_bHidden; // TRUE if the item has been removed.
|
||||
HMENU m_hMenu; // Handle to the menu this item belongs to.
|
||||
HMENU m_hSubMenu; // Handle to a submenu, if any, that belongs to this item.
|
||||
DWORD m_dwType; // Original item type flags.
|
||||
DWORD m_dwState; // Item state.
|
||||
DWORD m_dwHideType; // Used for drawing hidden items.
|
||||
DWORD m_iMBAlign; // Alignment of the associated menu bar.
|
||||
CString m_strText; // Item text.
|
||||
|
||||
// Returns: TRUE if the cool menu belongs to to the cool menu object.
|
||||
// Summary: This member function is called to determine if the item data for the
|
||||
// cool menu belongs to to the cool menu object.
|
||||
BOOL IsXTItemData();
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
class CXTMemDC;
|
||||
class CXTCoolMenu;
|
||||
class CXTWndShadow;
|
||||
|
||||
class CXTPopupMenu : public CXTWndHook
|
||||
{
|
||||
protected:
|
||||
|
||||
bool m_bOffset;
|
||||
BOOL m_bAnimationFinished;
|
||||
HMENU m_hMenu;
|
||||
CRect m_rectExclude;
|
||||
static int m_iRefCount;
|
||||
static BOOL m_bSysMenuAnimation;
|
||||
static BOOL m_bSysDropShadows;
|
||||
static BOOL m_bSysDropShadowsAvailable;
|
||||
CXTCoolMenu* m_pParent;
|
||||
|
||||
enum { WM_XT_FIX_XP_PAINT = WM_APP + 10, WM_XT_DEFER_DRAW_SHADOW };
|
||||
|
||||
public:
|
||||
|
||||
CXTPopupMenu();
|
||||
virtual ~CXTPopupMenu();
|
||||
|
||||
HWND GetHWnd();
|
||||
HMENU GetHMenu();
|
||||
|
||||
void SetParams(HMENU hMenu);
|
||||
void SetCoolMenuParent(CXTCoolMenu *pParent);
|
||||
void HideBeforeExpand();
|
||||
void DisableXPEffects();
|
||||
void OnDrawBorder(CDC* pDC);
|
||||
void ShowShadows();
|
||||
|
||||
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
friend class CXTCoolMenu;
|
||||
};
|
||||
|
||||
// Summary: CList definition for the popup menu array.
|
||||
typedef CList<CXTPopupMenu*, CXTPopupMenu*&> CXTPopupMenuList;
|
||||
|
||||
// Summary: CList definition for the CMenu array.
|
||||
typedef CList<CMenu*,CMenu*> CXTMenuList;
|
||||
|
||||
// Summary: CList definition for the CXTItemData array.
|
||||
typedef CList<CXTItemData*,CXTItemData*> CXTItemList;
|
||||
|
||||
// NUMBERED LIST:
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTCoolMenu is a CXTWndHook derived class. CXTCoolMenu manages the
|
||||
// cool menus for the application. The images are drawn based upon toolbar
|
||||
// resources that are passed in and are displayed next to the menu text
|
||||
// associated with the toolbar command ID.
|
||||
//
|
||||
// Some restrictions apply to cool menus if the XT menu bar (CXTMenuBar) is
|
||||
// not used:
|
||||
// [ol]
|
||||
// [li]Intelligent menus cannot be used.[/li]
|
||||
// [li]XP skinning and shadows can only be used on Win2k or later operating
|
||||
// systems.[/li]
|
||||
// [/ol]
|
||||
class _XT_EXT_CLASS CXTCoolMenu : public CXTWndHook
|
||||
{
|
||||
friend class CXTColorPopup;
|
||||
friend class CXTMenu;
|
||||
|
||||
DECLARE_DYNAMIC(CXTCoolMenu)
|
||||
|
||||
public:
|
||||
|
||||
// Input: bNoToolbar - DEPRECATED: The value of this parameter is ignored.
|
||||
// Summary: Constructs a CXTCoolMenu object.
|
||||
CXTCoolMenu(BOOL bNoToolbar=FALSE);
|
||||
|
||||
// Summary: Destroys a CXTCoolMenu object, handles cleanup and de-allocation.
|
||||
virtual ~CXTCoolMenu();
|
||||
|
||||
protected:
|
||||
|
||||
int m_nRecentList; // Number of items the recent item list cycles through.
|
||||
int m_nIDEvent; // Menu timer ID.
|
||||
int m_nTimeOut; // Time-out value, in milliseconds.
|
||||
BOOL m_bIntelligent; // TRUE if intelligent menus are enabled.
|
||||
bool m_bTimerActive; // true when the timer has been activated.
|
||||
BOOL m_bHasMnemonics; // (Win2K) TRUE if 'use menu underlines' is turned off in the control panel.
|
||||
BOOL m_bIsTrackPopup; // TRUE if the current menu was activated through TrackPopupMenu.
|
||||
CSize m_sizeBmp; // Size of the button bitmap.
|
||||
CSize m_sizeBtn; // Size of the button, including shadow.
|
||||
static int m_iIgnoreCount; // Incremented when user calls IgnoreNextPopup();.
|
||||
CUIntArray m_arCommandID; // Array of command IDs to hide.
|
||||
static bool m_bLastMouseEvent; // true if last message was WM_MOUSEMOVE and not WM_KEYDOWN
|
||||
static CSize m_szPopupBorder; // Size of the border of popup menus.
|
||||
static CSize m_szIconMargin; // Size of the icon margins.
|
||||
CXTMenuList m_menuList; // List of the CMenu objects initialized.
|
||||
CXTItemList m_itemList; // List of the item data pointers.
|
||||
|
||||
public:
|
||||
|
||||
static int m_nAnimationDelay; // The number of milliseconds for animation effect. Default value is 300.
|
||||
static int m_nAnimationSteps; // The number of steps used in the animation effect. Default value is 5.
|
||||
static bool m_bShowAll; // true when the cool menu displays hidden commands.
|
||||
static bool m_bAllowIntelligent; // Set to true when the popup is generated through CXTMenu which implements part of the intelligent menu's logic.
|
||||
static bool m_bIsPopup; // true if the menu is not owned by CXTMenuBar.
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Summary: Type of animation to perform.
|
||||
// This parameter can be one of the following values:
|
||||
// [ul]
|
||||
// [li]<b>animateWindowsDefault</b> Animation as defined in the "Display" settings.[/li]
|
||||
// [li]<b>animateRandom</b> Any of the first three in random selection.[/li]
|
||||
// [li]<b>animateUnfold</b> Unfold top to bottom.[/li]
|
||||
// [li]<b>animateSlide</b> Slide in from left.[/li]
|
||||
// [li]<b>animateFade</b> Fade-in.[/li]
|
||||
// [li]<b>animateNone</b> No animation.[/li]
|
||||
// [/ul]
|
||||
// The default value is animateWindowsDefault.
|
||||
// You can add a new animation effect, see the CXTAnimationMemDC description.
|
||||
// See Also: CXTAnimationMemDC
|
||||
static int m_nAnimationType;
|
||||
|
||||
static int m_iMenuBarAlign; // Used by menu bar for linking menu bar button to menu (XP style)
|
||||
static CRect m_rectExclude;
|
||||
|
||||
// Input: nID - The command ID to get the index for.
|
||||
// bEnabled - true if the command ID is from the enabled image list.
|
||||
// Returns: The index of the specified command, or -1 if the command
|
||||
// is not found.
|
||||
// Summary: This member function returns the index for the specified command.
|
||||
int GetButtonIndex(WORD nID, bool bEnabled=true);
|
||||
|
||||
// Input: nElapse - Specifies the time-out value, in milliseconds.
|
||||
// nIDEvent - Specifies a nonzero timer identifier.
|
||||
// Summary: This member function will set the timer identifier and time-out value
|
||||
// for the cool menu. The timer is activated when the mouse hovers over a
|
||||
// chevron when using intelligent menus. NOTE: if you are not using
|
||||
// the CXTMenuBar with your application you should set this to a
|
||||
// value of 100, otherwise you will need to also call CXTMenuBar::SetTimerInfo()
|
||||
// if you are changing the 'nIDEvent' parameter.
|
||||
void SetTimerInfo(UINT nElapse, UINT nIDEvent=1000);
|
||||
|
||||
// Input: bIntelligent - TRUE to enable intelligent menus. FALSE to disable intelligent menus.
|
||||
// Summary: This member function will enable or disable the intelligent menu feature.
|
||||
void SetIntelligentMode(BOOL bIntelligent=TRUE);
|
||||
|
||||
// Input: pFrame - Pointer to a CFrameWnd object that represents the application's main
|
||||
// window. If NULL, this will uninstall the cool menus.
|
||||
// Summary: This member function is called to install cool menus for the application.
|
||||
virtual void Install(CFrameWnd* pFrame);
|
||||
|
||||
// Input: nToolbarID - The resource ID of a toolbar to extract images
|
||||
// from, to be displayed in cool menus.
|
||||
// bEnabled - true if the toolbar is for enabled images.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will load a toolbar resource and extract
|
||||
// each button image to be used with its associated menu command.
|
||||
virtual BOOL LoadToolbar(UINT nToolbarID, bool bEnabled=true);
|
||||
|
||||
// Input: toolbar - Reference to a CToolBarCtrl object.
|
||||
// bEnabled - true if the toolbar is for enabled images.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will load a toolbar resource and extract
|
||||
// each button image to be used with its associated menu command.
|
||||
virtual BOOL LoadToolbar(CToolBarCtrl& toolbar, bool bEnabled=true);
|
||||
|
||||
// Input: nToolbarIDs - An array of toolbar resource IDs used to extract
|
||||
// images from, to be displayed in cool menus.
|
||||
// nSize - Size of the array passed in.
|
||||
// bEnabled - true if the toolbar array is for enabled images.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will load a toolbar resource and extract
|
||||
// each button image to be used with its associated menu command.
|
||||
virtual BOOL LoadToolbars(const UINT* nToolbarIDs, int nSize, bool bEnabled=true);
|
||||
|
||||
// Input: nCommandID - The command ID of a menu item to hide.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified command to the list of
|
||||
// menu items to hide until activated by clicking on the chevron.
|
||||
virtual BOOL HideCommand(UINT nCommandID);
|
||||
|
||||
// Input: lpszItem - Text string representing the popup menu item to hide.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified menu item to the list of
|
||||
// menu items to hide until activated by clicking on the chevron.
|
||||
virtual BOOL HideCommand(LPCTSTR lpszItem);
|
||||
|
||||
// Input: nCommandIDs - An array of command IDs, of menu items, to hide.
|
||||
// nSize - Size of the array passed in.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified commands to the list of
|
||||
// menu items to hide until activated by clicking on the chevron.
|
||||
virtual BOOL HideCommands(const UINT* nCommandIDs, int nSize);
|
||||
|
||||
// Input: lpszItems - An array of command IDs, of menu items, to hide.
|
||||
// nSize - Size of the array passed in.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified menu items to the list of
|
||||
// menu items to hide until activated by clicking on the chevron.
|
||||
virtual BOOL HideCommands(const LPCTSTR lpszItems, int nSize);
|
||||
|
||||
// Input: hIcon - Handle to the icon to add.
|
||||
// uCmdID - Command id of the icon.
|
||||
// bEnabled - true if the image is to be added to the enabled image list.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will append the specified image resource (hIcon)
|
||||
// to the existing cool menu image list, and map the associated
|
||||
// command ID (uCmdID) to the newly added image.
|
||||
virtual BOOL AppendImageList(HICON hIcon, UINT uCmdID, bool bEnabled/*=true*/);
|
||||
|
||||
// Input: nBitmapID - Resource ID of the new bitmap to add to the cool
|
||||
// menu's image list.
|
||||
// arCmdIDs - Array of menu command(s) to be associated with the
|
||||
// newly added image.
|
||||
// nSize - Size of the array passed in.
|
||||
// bEnabled - true if the image is to be added to the enabled image list.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will append the specified image resource (bitmap)
|
||||
// to the existing cool menu image list, and map the associated
|
||||
// command IDs to the newly added images.
|
||||
virtual BOOL AppendImageList(UINT nBitmapID, UINT* arCmdIDs, int nSize, bool bEnabled=true);
|
||||
|
||||
// Input: hBitmap - Handle of the new bitmap to add to the cool menu's image list.
|
||||
// arCmdIDs - Array of menu command(s) to be associated with the
|
||||
// newly added image.
|
||||
// nSize - Size of the array passed in.
|
||||
// bEnabled - true if the image is to be added to the enabled image list.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will append the specified image resource (bitmap)
|
||||
// to the existing cool menu image list, and map the associated
|
||||
// command IDs to the newly added images.
|
||||
virtual BOOL AppendImageList(HBITMAP hBitmap, UINT* arCmdIDs, int nSize, bool bEnabled=true);
|
||||
|
||||
// Input: pMenu - Points to the active menu.
|
||||
// nCommandID - Command ID of a menu item.
|
||||
// Returns: The position of the menu item if it exists, otherwise returns -1.
|
||||
// Summary: Call this member function to check for the existence of a menu item.
|
||||
virtual int MenuItemExists(CMenu* pMenu, UINT nCommandID);
|
||||
|
||||
// Input: nLength - Number of items the recent item list contains. Set to 0 to
|
||||
// disable this feature.
|
||||
// Summary: This member function sets the number of hidden items that can be
|
||||
// added to the short menu at any given time.
|
||||
virtual void SetRecentItemLength(int nLength);
|
||||
|
||||
// Summary: This member function is called to reset the recent item list used to
|
||||
// add recently used hidden items to the short menu.
|
||||
virtual void ResetUsageData();
|
||||
|
||||
// Summary: Call this member function if the next popup menu is not to be
|
||||
// transformed by the CXTCoolMenu class. For instance, use this before
|
||||
// displaying system menus.
|
||||
static void IgnoreNextPopup();
|
||||
|
||||
// Input: size - Represents the new size of the cool menu icons.
|
||||
// Summary: Call this member function to set the default icon size for cool menus.
|
||||
// This will override the size that was set when LoadToolbar was called.
|
||||
// This member should be called <b>after</b> InstallCoolMenus has been called
|
||||
// in the frame class. Standard size is 16x15 pixels.
|
||||
virtual void SetIconSize(CSize size);
|
||||
|
||||
// Returns: A CSize object that represents the current icon size for cool menu
|
||||
// images.
|
||||
// Summary: Call this member function to get the default icon size for cool menus.
|
||||
virtual CSize GetIconSize();
|
||||
|
||||
// Input: nIDCmd - Command ID to associate with the newly added image.
|
||||
// hIcon - Icon handle of the image to add.
|
||||
// sz - Width and height of the newly added item.
|
||||
// bEnabled - true if the image is to be added to the enabled image list.
|
||||
// Summary: This member function is called to add an image to the image map for
|
||||
// the cool menus.
|
||||
virtual void AddImageToMap(UINT nIDCmd, HICON hIcon, CSize sz, bool bEnabled=true);
|
||||
public:
|
||||
virtual BOOL HookWindow(HWND hWnd);
|
||||
virtual BOOL HookWindow(CWnd* pWnd);
|
||||
|
||||
protected:
|
||||
|
||||
// Input: pDC - Points to the current device context.
|
||||
// rect - Size of the area to paint.
|
||||
// strText - A CString object that represents the text to be displayed.
|
||||
// clrColor - An RGB value that represents the color of the text to be displayed.
|
||||
// Summary: This member function is called by the cool menu to paint a menu item's text.
|
||||
virtual void DrawMenuText(CDC* pDC, CRect rect, CString strText, COLORREF clrColor);
|
||||
|
||||
// Input: pDC - Points to the current device context.
|
||||
// rect - Size of the area to paint.
|
||||
// bSelected - TRUE if the checkmark is to be drawn highlighted.
|
||||
// bDisabled - TRUE if the checkmark is to be drawn disabled.
|
||||
// hbmCheck - HBITMAP handle to the menu item info checkmark. It can be NULL.
|
||||
// Summary: This member function is called by the cool menu to paint checkmarks
|
||||
// and radio buttons for each item.
|
||||
virtual void Draw3DCheckmark(CDC* pDC,const CRect& rect,BOOL bSelected,BOOL bDisabled,HBITMAP hbmCheck);
|
||||
|
||||
// Input: pDC - Points to the current device context.
|
||||
// rcItem - Size of the area to paint.
|
||||
// bSelected - TRUE if the chevron is to be drawn highlighted.
|
||||
// Summary: This member function is called by the cool menu to paint a chevron
|
||||
// that is used to display hidden menu items.
|
||||
virtual void DrawChevron(CDC* pDC,CRect rcItem,BOOL bSelected);
|
||||
|
||||
// Input: pMenu - Points to a CMenu object to be made 'cool'.
|
||||
// bHasButtons - TRUE if the menu has icons.
|
||||
// Summary: This member function is called by the cool menu to convert the specified
|
||||
// CMenu object to a 'cool' menu.
|
||||
virtual void ConvertMenu(CMenu* pMenu,BOOL bHasButtons);
|
||||
|
||||
// Input: nCommandID - Command ID of a menu item.
|
||||
// Returns: TRUE if the item is hidden, otherwise returns FALSE.
|
||||
// Summary: This member function is called by the cool menu to check to see
|
||||
// if the specified menu item is to be hidden.
|
||||
virtual BOOL IsItemHidden(UINT nCommandID);
|
||||
|
||||
// Input: pMenu - Points to the active menu.
|
||||
// nPos - Position of a menu item.
|
||||
// Returns: TRUE if the menu item is a separator, otherwise returns FALSE.
|
||||
// Summary: This member function is called by the cool menu to check to see
|
||||
// if the menu item is a separator.
|
||||
BOOL IsItemSeparator(CMenu* pMenu,int nPos);
|
||||
|
||||
// Input: pMenu - Points to the active menu.
|
||||
// nPos - Position of a menu item.
|
||||
// Returns: TRUE if the previous menu item is hidden, otherwise returns FALSE.
|
||||
// Summary: This member function is called by the cool menu to check to see
|
||||
// if the previous menu item is hidden.
|
||||
virtual BOOL IsPrevItemHidden(CMenu* pMenu,int nPos);
|
||||
|
||||
// Input: pMenu - Points to the active menu.
|
||||
// nPos - Position of a menu item.
|
||||
// Returns: TRUE if the next menu item is hidden, otherwise returns FALSE.
|
||||
// Summary: This member function is called by the cool menu to check to see
|
||||
// if the next menu item is hidden.
|
||||
virtual BOOL IsNextItemHidden(CMenu* pMenu,int nPos);
|
||||
|
||||
// Input: hMenu - Points to the active menu.
|
||||
// nPos - Position of a menu item.
|
||||
// Returns: TRUE if the menu item is the first one visible, otherwise returns FALSE.
|
||||
// Summary: This member function is called by the cool menu to check to see
|
||||
// if the menu item is the first one visible.
|
||||
virtual BOOL IsFirstVisibleItem(HMENU hMenu,UINT nPos);
|
||||
|
||||
// Input: hMenu - Points to the active menu.
|
||||
// nPos - Position of a menu item.
|
||||
// cmd - Command ID of the item to check.
|
||||
// Returns: TRUE if the menu item is the last one visible, otherwise returns FALSE.
|
||||
// Summary: This member function is called by the cool menu to check to see if
|
||||
// the menu item is the last one visible.
|
||||
virtual BOOL IsLastVisibleItem(HMENU hMenu,UINT nPos,UINT cmd);
|
||||
|
||||
// Input: pMenu - CMenu pointer to the active menu.
|
||||
// bAppend - TRUE to append the menu.
|
||||
// Returns: TRUE if the menu was actually modified.
|
||||
// Summary: This member function is called by the cool menu to append a chevron
|
||||
// menu item if the menu has hidden commands.
|
||||
virtual BOOL UpdateChevronItem(CMenu* pMenu,BOOL bAppend);
|
||||
|
||||
// Input: pMenu - CMenu pointer to the active menu.
|
||||
// Returns: TRUE if the menu item is a system menu, otherwise returns FALSE.
|
||||
// Summary: This member function is called by the cool menu to verify if the
|
||||
// specified menu is a system menu or not.
|
||||
virtual BOOL IsSysMenu(CMenu* pMenu);
|
||||
|
||||
// Input: pMenu - CMenu pointer to the active menu.
|
||||
// Returns: TRUE if there was a change to the menu.
|
||||
// Summary: This member function is called by the cool menu to restore previously
|
||||
// hidden menu items.
|
||||
virtual BOOL RestoreMenuItems(CMenu* pMenu);
|
||||
|
||||
// Input: pMenu - CMenu pointer to the active menu.
|
||||
// Summary: This member function is called by the cool menu to hide menu items.
|
||||
virtual void HideMenuItems(CMenu* pMenu);
|
||||
|
||||
// Input: pMenu - CMenu pointer to the active menu.
|
||||
// Returns: TRUE if the menu has hidden items, otherwise returns FALSE.
|
||||
// Summary: This member function is called by the cool menu to check for hidden
|
||||
// items.
|
||||
virtual BOOL HasHiddenItems(CMenu* pMenu);
|
||||
|
||||
// Input: nItem - Menu item command ID.
|
||||
// Returns: TRUE if the menu item was added to the recent item list, otherwise returns FALSE.
|
||||
// Summary: This member function is called by the cool menu to add a hidden
|
||||
// item to the short menu.
|
||||
virtual BOOL AddRecentItem(UINT nItem);
|
||||
|
||||
// Input: nItem - Menu item command ID.
|
||||
// Returns: TRUE if the menu item is in the recent item list, otherwise returns FALSE.
|
||||
// Summary: This member function is called by the cool menu to see if the specified
|
||||
// item is in the recent item list.
|
||||
virtual BOOL IsRecentItem(UINT nItem);
|
||||
|
||||
// Returns: true if the menus are allowed to use intelligent mode, otherwise returns false.
|
||||
// The default implementation allows intelligent menus only if the menu was
|
||||
// created through the CXTMenu class.
|
||||
// Summary: This internal member function checks to see if the menus are allowed
|
||||
// to use intelligent mode.
|
||||
virtual bool IsIntelligentModeAllowed();
|
||||
|
||||
|
||||
// Used by owner-drawn menu overrides
|
||||
|
||||
static void UnhookCBTHook();
|
||||
static void HookCBTHook();
|
||||
static void RemoveBorder(HWND hWnd);
|
||||
static HHOOK m_hCBTHook;
|
||||
static LRESULT CALLBACK CBTHook(int nCode, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
friend class CXTCoolMenuInit;
|
||||
friend class CXTPopupMenu;
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTCoolMenu)
|
||||
virtual void Destroy();
|
||||
virtual void Refresh();
|
||||
virtual void OnMenuTimer(int nIDEvent);
|
||||
virtual void OnInitMenuPopup(CMenu* pMenu, UINT nIndex, BOOL bSysMenu);
|
||||
virtual BOOL OnMeasureItem(LPMEASUREITEMSTRUCT lpms);
|
||||
virtual BOOL OnDrawItem(LPDRAWITEMSTRUCT lpds);
|
||||
virtual LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu);
|
||||
virtual void OnMenuSelect(UINT nItemID, UINT nFlags, HMENU hSysMenu);
|
||||
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
public:
|
||||
static bool m_bInstalled;
|
||||
|
||||
private:
|
||||
static bool m_bIs95orNT4;
|
||||
static bool m_bChevronSelected;
|
||||
static HMENU m_hMenuLast;
|
||||
static CXTPopupMenu* m_pPopupLast;
|
||||
static CXTPopupMenuList m_listPopups;
|
||||
int m_nTextHeight;
|
||||
};
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTMenu is a CMenu derived class. It is used to create a CXTMenu object.
|
||||
// Use this class if you want your popup to be 'intelligent'.
|
||||
//
|
||||
// Please note that intelligent menus have somewhat more limited capabilities
|
||||
// under <b>Windows 95 and Windows NT 4</b> (all other versions of Windows do
|
||||
// not suffer from these limitations):
|
||||
// [ul]
|
||||
// [li]The menu will not expand automatically if you hover over the chevron.[/li]
|
||||
// [li]Clicking on a chevron in a submenu will cause the submenu to close.[/li]
|
||||
// [li]Intelligent menus are not available if you do not use the docking
|
||||
// XT menu bar (CXTMenuBar).[/li]
|
||||
// [/ul]
|
||||
class _XT_EXT_CLASS CXTMenu : public CMenu
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTMenu object.
|
||||
CXTMenu();
|
||||
|
||||
// Summary: Destroys a CXTMenu object, handles cleanup and de-allocation.
|
||||
virtual ~CXTMenu();
|
||||
|
||||
// Input: nFlags - nFlags - Specifies a screen-position flag and a mouse-button flag.
|
||||
// x - Specifies the horizontal position in screen coordinates
|
||||
// of the popup menu.
|
||||
// y - Specifies the vertical position, in screen coordinates, of
|
||||
// the top of the menu on the screen.
|
||||
// pWnd - Identifies the window that owns the popup menu.
|
||||
// lpRect - Points to a RECT structure or a CRect object that contains
|
||||
// the screen coordinates of a rectangle within which the user
|
||||
// can click, without dismissing the popup menu.
|
||||
// bNotify - TRUE to send WM_COMMAND notification back to the owner window.
|
||||
// Returns: Nonzero if the function is successful, otherwise returns zero.
|
||||
// Summary: Call this member function to display a floating popup menu at the
|
||||
// specified location and track the selection of items on the popup menu.
|
||||
BOOL TrackPopupMenu(UINT nFlags,int x,int y,CWnd* pWnd,LPCRECT lpRect = NULL,BOOL bNotify = TRUE);
|
||||
|
||||
// Input: nFlags - Specifies a screen-position flag and a mouse-button flag.
|
||||
// x - Specifies the horizontal position, in screen coordinates,
|
||||
// of the popup menu.
|
||||
// y - Specifies the vertical position, in screen coordinates, of
|
||||
// the top of the menu on the screen.
|
||||
// pWnd - Identifies the window that owns the popup menu.
|
||||
// lptpm - Pointer to a TPMPARAMS structure that specifies an area
|
||||
// of the screen the menu should not overlap.
|
||||
// bNotify - TRUE to send WM_COMMAND notification back to the owner window.
|
||||
// Returns: Nonzero if the function is successful, otherwise returns zero.
|
||||
// Summary: Call this member function to display a floating popup menu at the
|
||||
// specified location and track the selection of items on the popup menu.
|
||||
BOOL TrackPopupMenuEx(UINT nFlags,int x,int y,CWnd* pWnd,LPTPMPARAMS lptpm = NULL,BOOL bNotify = TRUE);
|
||||
|
||||
// Input: hMenu - A Windows handle to a menu.
|
||||
// Returns: A pointer to a CMenu object. The pointer may be temporary or permanent.
|
||||
// Summary: Call this member function to get a pointer to a CMenu object given
|
||||
// a Windows handle to a menu.
|
||||
static CXTMenu* PASCAL FromHandle(HMENU hMenu);
|
||||
|
||||
// Input: hMenu - A Windows handle to a menu.
|
||||
// Returns: A pointer to a CMenu object. If a CMenu object is not attached to the handle,
|
||||
// NULL is returned.
|
||||
// Summary: Call this member function to get a pointer to a CMenu object when
|
||||
// given a handle to a window.
|
||||
static CXTMenu* PASCAL FromHandlePermanent(HMENU hMenu);
|
||||
|
||||
// Input: nPos - Specifies the position of the popup menu contained in the menu.
|
||||
// Returns: A pointer to a CMenu object, if a popup menu exists at the given position,
|
||||
// otherwise returns NULL.
|
||||
// Summary: Call this member function to get a pointer to a CMenu object whose
|
||||
// m_hMenu member contains a handle to the popup menu, if a popup menu
|
||||
// exists at the given position.
|
||||
CXTMenu* GetSubMenu(int nPos) const;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTCoolMenu::SetIntelligentMode(BOOL bIntelligent/*=TRUE*/) {
|
||||
m_bIntelligent = bIntelligent;
|
||||
}
|
||||
AFX_INLINE void CXTCoolMenu::SetRecentItemLength(int nLength) {
|
||||
m_nRecentList = nLength;
|
||||
}
|
||||
AFX_INLINE BOOL CXTCoolMenu::HookWindow(CWnd* pWnd) {
|
||||
return HookWindow(pWnd->GetSafeHwnd());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTCOOLMENU_H__)
|
||||
95
Editor/XT/Include/XTCustomToolbar.h
Normal file
95
Editor/XT/Include/XTCustomToolbar.h
Normal file
@@ -0,0 +1,95 @@
|
||||
// XTCustomToolBar.h interface for the CXTCustomToolBar class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XT_CUSTOMTOOLBAR__)
|
||||
#define __XT_CUSTOMTOOLBAR__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTCustomToolbar is a toolbar that gets dynamically created from
|
||||
// within toolbar customization page
|
||||
class _XT_EXT_CLASS CXTCustomToolBar : public CXTToolBar
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTCustomToolBar)
|
||||
|
||||
// Construction
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTCustomToolBar object.
|
||||
CXTCustomToolBar();
|
||||
|
||||
// Attributes
|
||||
|
||||
private:
|
||||
|
||||
CString m_strTitle; // Persistently stored title
|
||||
CImageList m_images; // images of the added buttons
|
||||
CImageList m_disabledImages; // disabled images of the added buttons, created only when CreateDisabledImageList() gets called
|
||||
|
||||
// Operations
|
||||
|
||||
public:
|
||||
|
||||
// Input: strNewName - Reference to the new name for the toolbar.
|
||||
// Summary: Persistently renames this toolbar
|
||||
void RenameCustomBar(const CString& strNewName);
|
||||
|
||||
// Summary: Deletes this toolbar
|
||||
void DeleteCustomBar();
|
||||
|
||||
// Returns: True if successful, otherwise returns false.
|
||||
// Summary: Creates and enables disabled image list
|
||||
bool CreateDisabledImageList();
|
||||
|
||||
// Overrides
|
||||
|
||||
// Input: pInfo - Pointer to a CXTCustomControlBarInfo object.
|
||||
// Summary: Fills in supported customizable features
|
||||
virtual void GetCustomBarInfo(CXTCustomControlBarInfo* pInfo);
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTCustomToolBar)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Destroys a CXTCustomToolBar object, handles cleanup and de-allocation.
|
||||
virtual ~CXTCustomToolBar();
|
||||
virtual void PostNcDestroy();
|
||||
virtual void ReportCustomGroups(CXTCustomGroups& groups);
|
||||
|
||||
// Generated message map functions
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTCustomToolBar)
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(__XT_CUSTOMTOOLBAR__)
|
||||
420
Editor/XT/Include/XTCustomizeAPI.h
Normal file
420
Editor/XT/Include/XTCustomizeAPI.h
Normal file
@@ -0,0 +1,420 @@
|
||||
// XTCustomizeAPI.h APIs used in toolbar customization
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTCUSTOMIZEAPI_H__)
|
||||
#define __XTCUSTOMIZEAPI_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
// f.forwards
|
||||
|
||||
struct XT_DROPDOWNBUTTON;
|
||||
class CXTIconMap;
|
||||
|
||||
// Summary: Descriptor of a control bar that supports customizations
|
||||
class CXTCustomControlBarInfo
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
bool m_bCanShowHide; // true if this control bar can toggle its visibility on/off
|
||||
bool m_bDynamic; // true if this bar was dynamically created
|
||||
CControlBar* m_pBar; // A control bar that supports customizations
|
||||
|
||||
// Summary: Callback for renaming the control bar or NULL if operation is not supported.
|
||||
typedef CXTDelegate1<const CString&> RENAME;
|
||||
RENAME Rename;
|
||||
|
||||
// Summary: Callback for deleting the control bar or NULL if operation is not supported.
|
||||
typedef CXTDelegate0 REMOVE;
|
||||
REMOVE Remove;
|
||||
|
||||
// Summary: Callback for resetting the control bar or NULL if operation is not supported.
|
||||
typedef CXTDelegate0 RESET;
|
||||
RESET Reset;
|
||||
|
||||
CXTCustomControlBarInfo()
|
||||
: m_pBar(0)
|
||||
, m_bCanShowHide(false)
|
||||
, m_bDynamic(false)
|
||||
{}
|
||||
|
||||
};
|
||||
|
||||
// Summary: A delegate to store CXTCustomControlBarInfo's
|
||||
typedef CXTDelegate1<CXTCustomControlBarInfo*> STORECUSTOMINFO;
|
||||
|
||||
// Summary: A request to create a new customizable control bar
|
||||
class CXTNewCustomBarRequest
|
||||
{
|
||||
public:
|
||||
|
||||
UINT m_nBarID; // ID of the control bar to create
|
||||
CString m_strTitle; // The toolbar title
|
||||
CFrameWnd* m_pFrame; // Frame window on which to create the toolbar
|
||||
CControlBar* m_pNewBar; // Newly created custom bar
|
||||
|
||||
CXTNewCustomBarRequest()
|
||||
: m_pFrame(0)
|
||||
, m_nBarID(0)
|
||||
, m_pNewBar(0)
|
||||
{ }
|
||||
};
|
||||
|
||||
// Summary: An item included in the custom group
|
||||
class CXTCustomGroupItemInfo
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
CString m_strTitle; // Item title, will be displayed in commands listbox in customize dialog
|
||||
|
||||
// Summary: Known types of items being transferred
|
||||
enum Type
|
||||
{
|
||||
Button, // Toolbar button
|
||||
Control // A control on the toolbar
|
||||
};
|
||||
const Type m_type;
|
||||
|
||||
bool m_bOwnsDropDown; // true if owning a private copy of XT_DROPDOWNBUTTON
|
||||
UINT m_nCmdID; // Command or control identifier
|
||||
UINT m_nWidth; // Control width, valid for controls
|
||||
CString m_strLabel; // Button label
|
||||
CXTIconHandle m_icon; // Icon assigned to the command
|
||||
CXTIconHandle m_disabledIcon; // Disabled icon assigned to the command
|
||||
CXTIconHandle m_hotIcon; // Hot icon assigned to the command
|
||||
XT_DROPDOWNBUTTON* m_pDropDown; // Descriptor of the dropdown button
|
||||
|
||||
|
||||
// Construction
|
||||
|
||||
CXTCustomGroupItemInfo(Type type);
|
||||
virtual ~CXTCustomGroupItemInfo();
|
||||
|
||||
// Operations
|
||||
|
||||
// Summary: Implement if you derive from this class
|
||||
virtual CXTCustomGroupItemInfo* Clone() const;
|
||||
|
||||
private:
|
||||
|
||||
// no implementation
|
||||
|
||||
CXTCustomGroupItemInfo(const CXTCustomGroupItemInfo& other);
|
||||
CXTCustomGroupItemInfo& operator=(const CXTCustomGroupItemInfo& other);
|
||||
};
|
||||
|
||||
// Summary: CTypedPtrArray definition for the custom group item info array.
|
||||
typedef CTypedPtrArray<CPtrArray, CXTCustomGroupItemInfo*> CXTCustomGroupItemInfoArray;
|
||||
|
||||
// Summary: Customizable group descriptor, the group is identified by a group owner (can later
|
||||
// be queried for group content) and group ID to uniquely identify the group with its owner
|
||||
class CXTCustomGroupInfo
|
||||
{
|
||||
public:
|
||||
|
||||
int m_nSortPriority; // Sort priority customize dialog sorts groups by this number
|
||||
CString m_strTitle; // Group title
|
||||
CXTCustomGroupItemInfoArray m_items; // Items included in this group
|
||||
|
||||
// Construction
|
||||
|
||||
// Summary: Constructs a CustomGroupInfo object.
|
||||
CXTCustomGroupInfo();
|
||||
// Summary: Destroys a CustomGroupInfo object, handles cleanup and de-allocation.
|
||||
virtual ~CXTCustomGroupInfo();
|
||||
|
||||
void Copy(const CXTCustomGroupInfo* other);
|
||||
void DeleteItems();
|
||||
void DeleteItem(int nIndex);
|
||||
|
||||
private:
|
||||
// no implementation
|
||||
|
||||
CXTCustomGroupInfo(const CXTCustomGroupInfo& other);
|
||||
CXTCustomGroupInfo& operator=(const CXTCustomGroupInfo& other);
|
||||
};
|
||||
|
||||
// Summary: Array of custom groups
|
||||
class CXTCustomGroups : public CTypedPtrArray<CPtrArray, CXTCustomGroupInfo*>
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTCustomGroups object.
|
||||
CXTCustomGroups();
|
||||
// Summary: Destroys a CXTCustomGroups object, handles cleanup and de-allocation.
|
||||
virtual ~CXTCustomGroups();
|
||||
void RemoveAll();
|
||||
};
|
||||
|
||||
// Summary: Definition of the drop target
|
||||
interface IXTCustDropTarget
|
||||
{
|
||||
|
||||
// Input: ptCursor - location in screen coordinates
|
||||
// Returns: true to indicate the drop is possible
|
||||
// Summary: Checks to see if cursor is over the target
|
||||
virtual bool IsDropPoint(CPoint ptCursor) = 0;
|
||||
|
||||
// Input: pInfo - item being dragged
|
||||
// ptCursor - location in screen coordinates
|
||||
// bCopyAllowed - OUT: tells if copy operation is acceptable
|
||||
// Returns: true if the data has been accepted for the drop
|
||||
// Summary: Drag cursor is over the target notification
|
||||
virtual bool DragEnter(CXTCustomGroupItemInfo* pInfo,CPoint ptCursor,bool& bCopyAllowed) = 0;
|
||||
|
||||
|
||||
// Input: ptCursor - location in screen coordinates
|
||||
// Summary: Mouse is still over the target but position has changed
|
||||
virtual void DragMove(CPoint ptCursor) = 0;
|
||||
|
||||
// Summary: Mouse has left the building.
|
||||
virtual void DragLeave() = 0;
|
||||
|
||||
// Input: pInfo - item being dropped
|
||||
// ptCursor - location in screen coordinates
|
||||
// Summary: Mouse dropped, must accept the data
|
||||
virtual void Drop(CXTCustomGroupItemInfo* pInfo,CPoint ptCursor) = 0;
|
||||
};
|
||||
|
||||
|
||||
// Summary: A sink to report a drop target
|
||||
interface IXTCustDropSink
|
||||
{
|
||||
virtual void Add(IXTCustDropTarget* target) = 0;
|
||||
};
|
||||
|
||||
// Summary: A connection point for objects involved in customize toolbar operations
|
||||
class CXTCustomizeConnection : public CObject
|
||||
{
|
||||
|
||||
bool m_bEnableCmdUI;
|
||||
bool m_bCustMode;
|
||||
CPoint m_startPoint; // Last known point of a newly created toolbar.
|
||||
CObArray m_garbage; // Array of objects scheduled for garbage collection.
|
||||
|
||||
|
||||
// Construction
|
||||
|
||||
private:
|
||||
CXTCustomizeConnection();
|
||||
|
||||
public:
|
||||
static _XT_EXT_CLASS CXTCustomizeConnection* GetInstance();
|
||||
|
||||
// Operations
|
||||
|
||||
public:
|
||||
|
||||
// Summary: A delegate to check if the command shall be displayed in the customization dialog .
|
||||
typedef CXTDelegate1Ret<bool, UINT> ISCUSTCMD;
|
||||
ISCUSTCMD IsCustCmd;
|
||||
|
||||
// Summary: A delegate to create new customizable control bar.
|
||||
typedef CXTDelegate1<CXTNewCustomBarRequest*> CREATEBAR;
|
||||
CREATEBAR CreateBar;
|
||||
|
||||
// Summary: A delegate to properly place newly created customizable control bar.
|
||||
typedef CXTDelegate2<CFrameWnd*, CControlBar*> PLACEBAR;
|
||||
PLACEBAR PlaceBar;
|
||||
|
||||
// Summary: A delegate for to get info about custom command groups.
|
||||
typedef CXTMultiCastDelegate1<CXTCustomGroups&> GETCUSTOMGROUPS;
|
||||
GETCUSTOMGROUPS GetCustomGroups;
|
||||
|
||||
// Summary: A delegate to collect all command-to-icon associations.
|
||||
typedef CXTMultiCastDelegate1<CXTIconMap*> GETICONS;
|
||||
GETICONS GetIcons;
|
||||
|
||||
// Summary: A delegate for to get info about customizable control bars.
|
||||
typedef CXTMultiCastDelegate1<const STORECUSTOMINFO&> GETCUSTOMBARINFO;
|
||||
GETCUSTOMBARINFO GetCustomBarInfo;
|
||||
|
||||
// Summary: A delegate for resetting tracking state.
|
||||
typedef CXTMultiCastDelegate0 RESETTRACKING;
|
||||
RESETTRACKING ResetTracking;
|
||||
|
||||
// Summary: A delegate to receive notifications on customize mode on/off events.
|
||||
typedef CXTMultiCastDelegate1<bool> SETCUSTMODE;
|
||||
SETCUSTMODE SetCustMode;
|
||||
|
||||
// Summary: A delegate to obtain current drop targets.
|
||||
typedef CXTMultiCastDelegate1<IXTCustDropSink*> GETTARGETS;
|
||||
GETTARGETS GetTargets;
|
||||
|
||||
// Summary: Notifies that a control bar has been hidden/shown.
|
||||
typedef CXTMultiCastDelegate2<CControlBar*, bool> ONSHOWHIDE;
|
||||
ONSHOWHIDE OnShowHide;
|
||||
|
||||
// Summary: Notifies a new customizable bar has been created.
|
||||
typedef CXTMultiCastDelegate1<CXTCustomControlBarInfo*> ONNEWBAR;
|
||||
ONNEWBAR OnNewBar;
|
||||
|
||||
// Summary: Notifies customizable bar has been renamed.
|
||||
typedef CXTMultiCastDelegate2<CControlBar*, LPCTSTR> ONBARRENAMED;
|
||||
ONBARRENAMED OnBarRenamed;
|
||||
|
||||
// Summary: Notifies customizable bar has been destroyed.
|
||||
typedef CXTMultiCastDelegate1<CControlBar*> ONBARDESTROYED;
|
||||
ONBARDESTROYED OnBarDestroyed;
|
||||
|
||||
// Summary: Returns a menu handle given its ID (a DWORD).
|
||||
typedef CXTDelegate1Ret<HMENU, DWORD> GETMENUPOPUP;
|
||||
GETMENUPOPUP GetMenuPopup;
|
||||
|
||||
// Summary: Application command removed event, gets ID of the command removed.
|
||||
typedef CXTMultiCastDelegate1<UINT> ONCMDCHANGE;
|
||||
ONCMDCHANGE OnCmdRemoved;
|
||||
|
||||
// Returns: false if no data is in the profile.
|
||||
// Summary: A delegate to define operation for persisting toolbars to/from the registry.
|
||||
// Takes a parent frame pointer and a profile name to load from.
|
||||
// Default refers to LoadDynamicBarsImp().
|
||||
typedef CXTDelegate2Ret<bool, CFrameWnd*, LPCTSTR> PERSISTER;
|
||||
|
||||
|
||||
PERSISTER LoadDynamicBars; // A delegate to load dynamic custom toolbars from the registry (defaults to LoadDynamicBarsImp())
|
||||
PERSISTER SaveDynamicBars; // A delegate to store dynamically created toolbars to the registry (defaults to SaveBarsImp())
|
||||
|
||||
// Summary: A delegate to find out if a command is defined in the app.
|
||||
// Takes a command ID, returns true if the command is defined in the app.
|
||||
// Default refers to IsAppCmdImp().
|
||||
typedef CXTDelegate1Ret<bool, UINT> ISAPPCMD;
|
||||
ISAPPCMD IsAppCmd;
|
||||
|
||||
// Returns: True if successful, otherwise returns false.
|
||||
// Summary: Tells if customization is currently active.
|
||||
bool IsCustMode() const;
|
||||
|
||||
// Returns: True if successful, otherwise returns false.
|
||||
// Summary: Tells if UI shall be enabled during customization (valid if IsCustMode()
|
||||
// returns true).
|
||||
bool IsEnableCmdUI() const;
|
||||
|
||||
// Input: bEnableCmdUI - True to enable command.
|
||||
// Summary: Sets the flag telling if UI shall be enabled during toolbar customization
|
||||
// default (as set when toolbar customization is turned on) is true.
|
||||
void SetEnableCmdUI(bool bEnableCmdUI);
|
||||
|
||||
// Input: pTarget - Points to a CObject object.
|
||||
// Summary: Removes a target.
|
||||
void Remove(CObject* pTarget);
|
||||
|
||||
// Input: pWnd - A window to capture the mouse
|
||||
// canMove - True if the data can be moved to other locations
|
||||
// pInfo - Item to move/copy
|
||||
// Returns: true to indicate a move operation has been requested.
|
||||
// Summary: Processes drag-n-drop during toolbar customization.
|
||||
bool DragNDrop(CWnd* pWnd,bool canMove,CXTCustomGroupItemInfo* pInfo);
|
||||
|
||||
// Input: pRequest - Points to a CXTNewCustomBarRequest object.
|
||||
// Example: To customize, replace CreateBar delegate with you own version such as
|
||||
// shown below:
|
||||
// <pre>
|
||||
// BOOL CMyApp::InitInstance()
|
||||
// {
|
||||
// CXTCustomizeConnection::GetInstance()->CreateBar =
|
||||
// CXTCustomizeConnection::CREATEBAR(this,
|
||||
// CXTCustomizeConnection::CREATEBAR::CB(OnCreateCustomBar));
|
||||
// ..... other stuff ...
|
||||
// }
|
||||
// void CMyApp::OnCreateCustomBar(CXTNewCustomBarRequest* pRequest)
|
||||
// {
|
||||
// // create default toolbar
|
||||
// CXTCustomizeConnection::GetInstance()->CreateBarImp(pRequest);
|
||||
// CXTCustomToolBar* pBar = (CXTCustomToolBar*)pRequest->m_pNewBar;
|
||||
// .... customize pBar ....
|
||||
// }</pre>
|
||||
// Summary: Default implementation of the CreateBar delegate.
|
||||
// It creates CXTCustomToolBar objects.
|
||||
void CreateBarImp(CXTNewCustomBarRequest* pRequest);
|
||||
|
||||
// Input: obj - Points to a CObject object.
|
||||
// Summary: VC7 has ushered a bug that they call DestroyWindow() twice on the same dangling pointer
|
||||
// hence effectively precluding you from using 'delete this'
|
||||
// in PostNcDestroy(). All control bars created in your implementation:
|
||||
// [ol]
|
||||
// [li]shall not self-delete in PostNcDestroy()[/li]
|
||||
// [li]shall use garbage collection facility below where obj is the object
|
||||
// to be deleted later[/li]
|
||||
// [/ol]
|
||||
void ScheduleGC(CObject* obj);
|
||||
|
||||
// Summary: Companion to ScheduleGC() that actually deletes cached objects, called
|
||||
// when it is safe to do so.
|
||||
void RunGC();
|
||||
|
||||
// Input: nCmdID - Comamnd identifier.
|
||||
// Returns: True if successful, otherwise returns false.
|
||||
// Summary: Default implementation of the IsCustCmd delegate.
|
||||
// This function filters out IDs for MRU file list (ID_FILE_MRU1 thru 16)
|
||||
// Example: To customize, replace IsCustomizableCommand delegate with you own
|
||||
// version such as shown below.
|
||||
// <pre>
|
||||
// BOOL CMyApp::InitInstance()
|
||||
// {
|
||||
// CXTCustomizeConnection::GetInstance()->IsCustCmd =
|
||||
// CXTCustomizeConnection::ISCUSTCMD(this,
|
||||
// CXTCustomizeConnection::ISCUSTCMD::CB(IsCustCmd));
|
||||
// ..... other stuff ...
|
||||
// }
|
||||
// bool CMyApp::IsCustCmd(UINT nCmdID)
|
||||
// {
|
||||
// return CXTCustomizeConnection::GetInstance()->IsCustCmdImp(nCmdID) &&
|
||||
// nCmdID != ID_A_COMMAND;
|
||||
// }</pre>
|
||||
bool IsCustCmdImp(UINT nCmdID);
|
||||
|
||||
// Input: pFrame - Points to a CFrameWnd object.
|
||||
// lpszProfileName - Profile name to store in registry.
|
||||
// Returns: True if successful, otherwise returns false.
|
||||
// Summary: Default implementation of restoring dynamic custom toolbars
|
||||
// from the data persistently stored in the registry.
|
||||
bool LoadDynamicBarsImp(CFrameWnd* pFrame, LPCTSTR lpszProfileName);
|
||||
|
||||
// Input: pFrame - Points to a CFrameWnd object.
|
||||
// lpszProfileName - Profile name to store in registry.
|
||||
// Returns: True if successful, otherwise returns false.
|
||||
// Summary: Default implementation of saving dynamic custom toolbars
|
||||
// to the data persistently stored in the registry.
|
||||
bool SaveDynamicBarsImp(CFrameWnd* pFrame, LPCTSTR lpszProfileName);
|
||||
|
||||
// Input: pFrame - Points to a CFrameWnd object.
|
||||
// pBar - Points to a CControlBar object.
|
||||
// Summary: Default implementation of newly created toolbar placement
|
||||
// Floats the control bar.
|
||||
void PlaceBarImp(CFrameWnd* pFrame, CControlBar* pBar);
|
||||
|
||||
private:
|
||||
void OnSetCustMode(bool bMode);
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE bool CXTCustomizeConnection::IsCustMode() const {
|
||||
return m_bCustMode;
|
||||
}
|
||||
AFX_INLINE bool CXTCustomizeConnection::IsEnableCmdUI() const {
|
||||
return m_bEnableCmdUI;
|
||||
}
|
||||
AFX_INLINE void CXTCustomizeConnection::SetEnableCmdUI(bool bEnableCmdUI) {
|
||||
m_bEnableCmdUI = bEnableCmdUI;
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#endif //__XTCUSTOMIZEAPI_H__
|
||||
449
Editor/XT/Include/XTCustomizePage.h
Normal file
449
Editor/XT/Include/XTCustomizePage.h
Normal file
@@ -0,0 +1,449 @@
|
||||
// XTCustomizePage.h interface for the CXTCustToolBarPage class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTCUSTOMIZEPAGE_H__)
|
||||
#define __XTCUSTOMIZEPAGE_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
// forwards
|
||||
|
||||
class CXTCustomizeSheet;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTCustomizeContext is a CObject derived class. It creates a customization
|
||||
// context.
|
||||
class CXTCustomizeContext : public CObject
|
||||
{
|
||||
|
||||
private:
|
||||
CFrameWnd* const m_pFrameWnd; // A frame on which customizations are executed.
|
||||
|
||||
public:
|
||||
|
||||
// Input: pFrameWnd - A pointer to a CFrameWnd object.
|
||||
// Summary: Constructs a CXTCustomizeContext object.
|
||||
CXTCustomizeContext(CFrameWnd* pFrameWnd);
|
||||
|
||||
// Summary: Destroys a CXTCustomizeContext object, handles cleanup and de-allocation.
|
||||
virtual ~CXTCustomizeContext();
|
||||
|
||||
// Returns: A pointer to a CFrameWnd.
|
||||
// Summary: This member function gets the frame being customized.
|
||||
CFrameWnd* GetFrame() const;
|
||||
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE CFrameWnd* CXTCustomizeContext::GetFrame() const {
|
||||
return m_pFrameWnd;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTCustToolBarPage is a multiple inheritance class derived from CXTDialogState
|
||||
// and CXTResizePropertyPage. It is displayed during toolbar customization as the
|
||||
// first page in the customize tab control.
|
||||
class _XT_EXT_CLASS CXTCustToolBarPage : CXTDialogState, public CXTResizePropertyPage
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTCustToolBarPage)
|
||||
|
||||
// Summary: Descriptor of a toolbar rendered on this page.
|
||||
typedef CXTCustomControlBarInfo TBINFO;
|
||||
|
||||
// Summary: Array of toolbars rendered on this page.
|
||||
// NB: Can contain zeroed spots for destroyed control bars.
|
||||
CArray<TBINFO, TBINFO&> m_infos;
|
||||
|
||||
// Summary: Current customization context.
|
||||
CXTCustomizeContext* const m_context;
|
||||
|
||||
public:
|
||||
|
||||
// Input: context - Current customization context.
|
||||
// Summary: Constructs a CXTCustToolBarPage object.
|
||||
CXTCustToolBarPage(CXTCustomizeContext* context);
|
||||
|
||||
// Summary: Destroys a CXTCustToolBarPage object, handles cleanup and de-allocation.
|
||||
virtual ~CXTCustToolBarPage();
|
||||
|
||||
//{{AFX_DATA(CXTCustToolBarPage)
|
||||
|
||||
enum { IDD = XT_IDD_CUSTPAGE1 };
|
||||
CXTCheckListBox m_checkList;
|
||||
CButton m_resetButton;
|
||||
CButton m_renameButton;
|
||||
CButton m_deleteButton;
|
||||
CButton m_newButton;
|
||||
//}}AFX_DATA
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTCustToolBarPage)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX);
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTCustToolBarPage)
|
||||
afx_msg void OnChkChange();
|
||||
afx_msg void OnNew();
|
||||
afx_msg void OnSelchangeChecklist();
|
||||
afx_msg void OnRename();
|
||||
afx_msg void OnDelete();
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnClear();
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
// Input: nSel - Index of the list box item to select.
|
||||
// Summary: This member function is called by the page to set the selection
|
||||
// in the toolbar list box.
|
||||
void SetSelectItem(int nSel=0);
|
||||
|
||||
// Input: pInfo - A pointer to a CXTCustomControlBarInfo object.
|
||||
// Returns: An int value.
|
||||
// Summary: This member function adds an item.
|
||||
int AddItem(CXTCustomControlBarInfo* pInfo);
|
||||
|
||||
// Input: pBar - A pointer to a CControlBar object.
|
||||
// Summary: This member function removes an item by its position in the context.
|
||||
void OnBarDestroyed(CControlBar* pBar);
|
||||
|
||||
// Input: pBar - A pointer to a CControlBar object.
|
||||
// Returns: An int value.
|
||||
// Summary: This member function finds an item index by its position in the context.
|
||||
int CXTCustToolBarPage::FindItem(CControlBar* pBar) const;
|
||||
|
||||
// Input: pBar - A pointer to a CControlBar object.
|
||||
// bVisible - True to show, false to hide.
|
||||
// Summary: This member function is called when a control bar's visibility changes.
|
||||
void OnShowHideBar(CControlBar* pBar,bool bVisible);
|
||||
|
||||
// Input: pBar - A pointer to a CControlBar object.
|
||||
// pszText - A pointer to a string.
|
||||
// Summary: This member function is called when a control bar is renamed.
|
||||
void OnBarRenamed(CControlBar* pBar, LPCTSTR pszText);
|
||||
|
||||
// Input: pInfo - A pointer to a CXTCustomControlBarInfo object.
|
||||
// Summary: This member function adds custom bar information.
|
||||
void StoreInfo(CXTCustomControlBarInfo* pInfo);
|
||||
|
||||
// Input: pInfo - A pointer to a CXTCustomControlBarInfo object.
|
||||
// Summary: This member function adds custom bar information.
|
||||
void StoreNewInfo(CXTCustomControlBarInfo* pInfo);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTCustCommandsPage is a multiple inheritance class derived from CXTDialogState,
|
||||
// CXTResizePropertyPage, and CXTCommandsListBox::ISite. It is displayed during
|
||||
// toolbar customization as the second page in the customize tab control.
|
||||
class _XT_EXT_CLASS CXTCustCommandsPage : CXTDialogState,
|
||||
public CXTResizePropertyPage,
|
||||
public CXTCommandsListBox::ISite
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTCustCommandsPage)
|
||||
|
||||
CXTIconMap m_iconMap; // A map of command IDs to their icons.
|
||||
CXTCustomGroups m_groups; // Array of groups.
|
||||
CXTCustomizeContext* const m_context; // Current customization context.
|
||||
|
||||
public:
|
||||
|
||||
// Input: context - Current customization context.
|
||||
// Summary: Constructs a CXTCustCommandsPage object.
|
||||
CXTCustCommandsPage(CXTCustomizeContext* context);
|
||||
|
||||
|
||||
// Summary: Destroys a CXTCustCommandsPage object, handles cleanup and de-allocation.
|
||||
virtual ~CXTCustCommandsPage();
|
||||
|
||||
//{{AFX_DATA(CXTCustCommandsPage)
|
||||
|
||||
enum { IDD = XT_IDD_CUSTPAGE2 };
|
||||
CXTCommandsListBox m_listCommands;
|
||||
CXTListBox m_listGroups;
|
||||
CButton m_btnDescription;
|
||||
CStatic m_txtSelected;
|
||||
//}}AFX_DATA
|
||||
|
||||
CXTTipWindow m_tipWindow; // Displays information about the selected command.
|
||||
|
||||
// Summary: The page calls this member function to update the commands list
|
||||
// box contents.
|
||||
void UpdateListContents();
|
||||
|
||||
// Input: bEnable - TRUE to enable, FALSE to disable.
|
||||
// Summary: The page calls this member function to enable or disable the displayed
|
||||
// dialog controls.
|
||||
void SetEnableControls(BOOL bEnable);
|
||||
|
||||
// Input: nCmdID - Position (item data) of the item in the list box.
|
||||
// hIcon - destination to store command icon, valid if function returns true.
|
||||
// hDisabledIcon - destination to store disabled command icon, can be NULL, valid if function returns true.
|
||||
// hHotIcon - destination to store hot command icon, can be NULL, valid if function returns true.
|
||||
// Returns: true if found, false otherwise
|
||||
// Summary: This member function gets icons of a command .
|
||||
// Implements CXTCommandsListBox::ISite interface.
|
||||
virtual bool GetCommandIcon(UINT nCmdID,HICON& hIcon, HICON& hDisabledIcon,HICON& hHotIcon);
|
||||
|
||||
// Input: pos - Position (item data) of the item in the list box.
|
||||
// Returns: A UINT value. Implements CXTCommandsListBox::ISite interface.
|
||||
// Summary: This member function gets a command ID by its position.
|
||||
virtual UINT GetItemCommand(int pos);
|
||||
|
||||
// Input: pos - Position (item data) of the item in the list box.
|
||||
// Summary: This member function performs drag and drop of an item at the position
|
||||
// provided. Implements CXTCommandsListBox::ISite interface.
|
||||
virtual void DragNDrop(int pos);
|
||||
|
||||
// Input: nCmdID - Command ID
|
||||
// Summary: notification handler for a command removed event
|
||||
void OnCmdRemoved(UINT nCmdID);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTCustCommandsPage)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX);
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTCustCommandsPage)
|
||||
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
|
||||
afx_msg void OnSelchangeListCategories();
|
||||
afx_msg void OnBtnDescription();
|
||||
afx_msg void OnSelchangeListCommands();
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTCustAccelerators is a multiple inheritance class derived from CXTDialogState
|
||||
// and CXTResizePropertyPage. It is displayed during toolbar customization as the
|
||||
// keyboard page in the customize tab control. This class is used to create a
|
||||
// shortcut assignments dialog page for the keyboard tab in the customize dialog.
|
||||
class _XT_EXT_CLASS CXTCustAccelerators : CXTDialogState, public CXTResizePropertyPage
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTCustAccelerators)
|
||||
|
||||
|
||||
CXTCustomizeContext* const m_context; // Current customization context
|
||||
|
||||
public:
|
||||
|
||||
// Input: context - Current customization context.
|
||||
// Summary: Constructs a CXTCustAccelerators object.
|
||||
CXTCustAccelerators(CXTCustomizeContext* const context);
|
||||
|
||||
// Summary: Destroys a CXTCustAccelerators object, handles cleanup and de-allocation.
|
||||
virtual ~CXTCustAccelerators();
|
||||
|
||||
//{{AFX_DATA(CXTCustAccelerators)
|
||||
|
||||
enum { IDD = XT_IDD_CUSTPAGE3 };
|
||||
CXTAccelKeyEdit m_editShortcutKey;
|
||||
CXTListBox m_lboxKeys;
|
||||
CXTListBox m_lboxCommands;
|
||||
CComboBox m_comboCategory;
|
||||
CString m_strTitle;
|
||||
CString m_strDesc;
|
||||
int m_iCategory;
|
||||
//}}AFX_DATA
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTCustAccelerators)
|
||||
public:
|
||||
virtual BOOL OnSetActive();
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Summary: This member function is called by the page to reload the list items.
|
||||
void ReloadList();
|
||||
|
||||
// Summary: This member function is called by the page to enable the assignment buttons.
|
||||
void EnableControls();
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTCustAccelerators)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSelchangeCategory();
|
||||
afx_msg void OnSelchangeCommands();
|
||||
afx_msg void OnSelchangeCurKeys();
|
||||
afx_msg void OnChangeShortcutKey();
|
||||
afx_msg void OnAssign();
|
||||
afx_msg void OnResetAll();
|
||||
afx_msg void OnRemove();
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
typedef CList<XT_TOOL*,XT_TOOL*> CXTToolsList;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTCustTools is a multiple inheritance class derived from CXTDialogState
|
||||
// and CXTResizePropertyPage. It is displayed during toolbar customization as the
|
||||
// second page in the customize tab control.
|
||||
class _XT_EXT_CLASS CXTCustTools : CXTDialogState, public CXTResizePropertyPage
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTCustTools)
|
||||
|
||||
// Summary: Current customization context
|
||||
CXTCustomizeContext* const m_context;
|
||||
|
||||
public:
|
||||
|
||||
// Input: context - Current customization context.
|
||||
// Summary: Constructs a CXTCustTools object.
|
||||
CXTCustTools(CXTCustomizeContext* const context);
|
||||
|
||||
// Summary: Destroys a CXTCustTools object, handles cleanup and de-allocation.
|
||||
virtual ~CXTCustTools();
|
||||
|
||||
//{{AFX_DATA(CXTCustTools)
|
||||
|
||||
enum { IDD = XT_IDD_CUSTPAGE4 };
|
||||
CStatic m_txtToolsDir;
|
||||
CStatic m_txtToolsArg;
|
||||
CStatic m_txtToolsCmd;
|
||||
CString m_strToolsDir;
|
||||
CString m_strToolsArg;
|
||||
CString m_strToolsCmd;
|
||||
CXTBrowseEdit m_editToolsDir;
|
||||
CXTBrowseEdit m_editToolsArg;
|
||||
CXTBrowseEdit m_editToolsCmd;
|
||||
CXTEditListBox m_lboxToolsList;
|
||||
//}}AFX_DATA
|
||||
|
||||
CXTToolsList m_arTools;
|
||||
XT_TOOL* m_pOldData;
|
||||
|
||||
enum { XT_TOOLCMD, XT_TOOLARG, XT_TOOLDIR };
|
||||
|
||||
void UpdateToolsItem(LPCTSTR lpszText, int iWhich, bool bAppend);
|
||||
void UpdateToolData();
|
||||
void EnableControls(bool bEnable);
|
||||
void UpdateToolsList();
|
||||
void FreeToolsList(CXTToolsList& arTools, bool bAddTool=false);
|
||||
bool ValidateTools();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTCustTools)
|
||||
public:
|
||||
virtual BOOL OnKillActive();
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTCustTools)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSelchangeEditList();
|
||||
afx_msg void OnChangeToolsCmd();
|
||||
afx_msg void OnChangeToolsArg();
|
||||
afx_msg void OnChangeToolsDir();
|
||||
afx_msg void OnDestroy();
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg void OnLabelEditEnd();
|
||||
afx_msg void OnLabelEditCancel();
|
||||
afx_msg void OnNewItem();
|
||||
afx_msg void OnPreDeleteItem();
|
||||
afx_msg void OnDeleteItem();
|
||||
afx_msg void OnMoveItemUp();
|
||||
afx_msg void OnMoveItemDown();
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
// forwards
|
||||
|
||||
class CXTOptionsManager;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTCustOptions is a multiple inheritance class derived from CXTDialogState
|
||||
// and CXTResizePropertyPage. It is displayed during toolbar customization as the
|
||||
// second page in the customize tab control.
|
||||
class _XT_EXT_CLASS CXTCustOptions : CXTDialogState, public CXTResizePropertyPage
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTCustOptions)
|
||||
|
||||
CXTCustomizeContext* const m_context; // Current customization context
|
||||
|
||||
public:
|
||||
|
||||
// Input: context - Current customization context.
|
||||
// Summary: Constructs a CXTCustOptions object.
|
||||
CXTCustOptions(CXTCustomizeContext* const context);
|
||||
|
||||
// Summary: Destroys a CXTCustOptions object, handles cleanup and de-allocation.
|
||||
virtual ~CXTCustOptions();
|
||||
|
||||
//{{AFX_DATA(CXTCustOptions)
|
||||
|
||||
enum { IDD = XT_IDD_CUSTPAGE5 };
|
||||
CComboBox m_comboAnimationType;
|
||||
CButton m_chkShowFull;
|
||||
CButton m_chkToolBarAccelTips;
|
||||
BOOL m_bMenuShadows;
|
||||
BOOL m_bMenuRecentCommands;
|
||||
BOOL m_bToolBarScreenTips;
|
||||
BOOL m_bShowFullAfterDelay;
|
||||
BOOL m_bToolBarAccelTips;
|
||||
BOOL m_bToolBarVisualize;
|
||||
int m_nAnimationType;
|
||||
//}}AFX_DATA
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTCustOptions)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTCustOptions)
|
||||
afx_msg void OnMenuShadows();
|
||||
afx_msg void OnRecentMenu();
|
||||
afx_msg void OnShowFull();
|
||||
afx_msg void OnBtnReset();
|
||||
afx_msg void OnScreenTips();
|
||||
afx_msg void OnShowShortcutKeys();
|
||||
afx_msg void OnVisualize();
|
||||
afx_msg void OnAnimation();
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
void AddString( UINT nIDResource );
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTCUSTOMIZEPAGE_H__)
|
||||
107
Editor/XT/Include/XTCustomizeSheet.h
Normal file
107
Editor/XT/Include/XTCustomizeSheet.h
Normal file
@@ -0,0 +1,107 @@
|
||||
// XTCustomizeSheet.h interface for the CXTCustomizeSheet class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTCUSTOMIZESHEET_H__)
|
||||
#define __XTCUSTOMIZESHEET_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTCustomizeSheet is a multiple inheritance class derived from CXTDialogState
|
||||
// and CXTResizePropertySheet. It is a property sheet that is displayed during
|
||||
// toolbar customization.
|
||||
class _XT_EXT_CLASS CXTCustomizeSheet : CXTDialogState, public CXTResizePropertySheet
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTCustomizeSheet)
|
||||
|
||||
CMap<HWND, HWND, bool, bool> m_map; // A map to store active custom bars that get mouse input.
|
||||
|
||||
public:
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: pFrameWnd - Pointer to the frame window on which to execute customizations.
|
||||
// dwCustStyle - Specifies which pages to include when the customize dialog is
|
||||
// displayed. It can be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>CUST_XT_TOOLBARS</b> Displays the Toolbars tab in the toolbar customize property sheet.[/li]
|
||||
// [li]<b>CUST_XT_COMMANDS</b> Displays the Commands tab in the toolbar customize property sheet.[/li]
|
||||
// [li]<b>CUST_XT_KEYBOARD</b> Displays the Keyboard tab in the toolbar customize property sheet.[/li]
|
||||
// [li]<b>CUST_XT_TOOLS</b> Displays the Tools tab in the toolbar customize property sheet.[/li]
|
||||
// [li]<b>CUST_XT_OPTIONS</b> Displays the Options tab in the toolbar customize property sheet.[/li]
|
||||
// [li]<b>CUST_XT_DEFAULT</b> Same as CUST_XT_TOOLBARS|CUST_XT_COMMANDS|CUST_XT_KEYBOARD|CUST_XT_OPTIONS.[/li]
|
||||
// If no flags are defined the constructor will ASSERT.
|
||||
// Summary: Constructs a CXTCustomizeSheet object.
|
||||
CXTCustomizeSheet(CFrameWnd* pFrameWnd,DWORD dwCustStyle);
|
||||
|
||||
// Summary: Destroys a CXTCustomizeSheet object, handles cleanup and de-allocation.
|
||||
virtual ~CXTCustomizeSheet();
|
||||
|
||||
bool m_bAppActive; // true if the application is currently active, or false otherwise.
|
||||
CRect m_rcPage; // Size for each page displayed.
|
||||
CXTCustTools* m_pPage4; // Fourth property page.
|
||||
CXTCustOptions* m_pPage5; // Fifth property page.
|
||||
CXTCustToolBarPage* m_pPage1; // First property page.
|
||||
CXTCustomizeContext m_context; // Current context.
|
||||
CXTCustCommandsPage* m_pPage2; // Second property page.
|
||||
CXTCustAccelerators* m_pPage3; // Third property page.
|
||||
|
||||
// Input: bMode - true to enable toolbar customization.
|
||||
// Summary: This member function sets the customization mode on or off in all applicable
|
||||
// control bars.
|
||||
void SetCustMode(bool bMode);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTCustomizeSheet)
|
||||
public:
|
||||
virtual BOOL OnInitDialog();
|
||||
virtual INT_PTR DoModal();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTCustomizeSheet)
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg BOOL OnNcActivate(BOOL bActive);
|
||||
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
||||
afx_msg void OnCloseBtn();
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
private:
|
||||
|
||||
CFrameWnd* m_pWndParent;
|
||||
|
||||
bool FilterMouse(LPARAM lParam);
|
||||
bool FilterKey(LPARAM lParam);
|
||||
void StoreInfo(CXTCustomControlBarInfo* pInfo);
|
||||
void OnBarDestroyed(CControlBar* pBar);
|
||||
|
||||
friend class CXTCustomizeContext;
|
||||
friend class CXTCustToolBarPage;
|
||||
friend class CXTCustCommandsPage;
|
||||
friend class CXTCustAccelerators;
|
||||
friend class CXTCustTools;
|
||||
friend class CXTCustOptions;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTCUSTOMIZESHEET_H__)
|
||||
759
Editor/XT/Include/XTDateTimeCtrl.h
Normal file
759
Editor/XT/Include/XTDateTimeCtrl.h
Normal file
@@ -0,0 +1,759 @@
|
||||
// XTDateTimeCtrl.h interface for the CXTDateTimeCtrl class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTDATETIMECTRL_H__)
|
||||
#define __XTDATETIMECTRL_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
// class forwards
|
||||
|
||||
class CXTMonthCalCtrl;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTDateTimeCtrl is a CWnd derived class. A CXTDateTimeCtrl object encapsulates
|
||||
// the functionality of a date and time picker control. The date and time
|
||||
// picker control (DTP control) provides a simple interface to exchange
|
||||
// date and time information with a user. This interface contains fields,
|
||||
// each of which displays a part of the date and time information stored
|
||||
// in the control. The user can change the information stored in the control
|
||||
// by changing the content of the string in a given field. The user can
|
||||
// move from field to field using the mouse or the keyboard.
|
||||
//
|
||||
// You can customize the date and time picker control by applying a variety
|
||||
// of styles to the object when you create it. See Date and Time Picker
|
||||
// Control Styles in the Platform SDK for more information about styles
|
||||
// specific to the date and time picker control. You can set the display
|
||||
// format of the DTP control using format styles. These format styles
|
||||
// are described in Preset DTP Display Formats in the Platform SDK.
|
||||
//
|
||||
// The date and time picker control also uses notifications and callbacks,
|
||||
// which are described in Using CXTDateTimeCtrl in the Xtreme Toolkit online
|
||||
// help.
|
||||
class _XT_EXT_CLASS CXTDateTimeCtrl : public CWnd
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTDateTimeCtrl)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTDateTimeCtrl object.
|
||||
CXTDateTimeCtrl();
|
||||
|
||||
// Summary: Destroys a CXTDateTimeCtrl object, handles cleanup and de-allocation.
|
||||
virtual ~CXTDateTimeCtrl();
|
||||
|
||||
// Input: dwStyle - Specifies the combination of date time control
|
||||
// styles. See Date and Time Picker Control Styles
|
||||
// in the Platform SDK for more information about
|
||||
// date and time picker styles.
|
||||
// rect - A reference to a RECT structure, which is the
|
||||
// position and size of the date and time picker control.
|
||||
// pParentWnd - A pointer to a CWnd object that is the parent
|
||||
// window of the date and time picker control. It
|
||||
// must not be NULL.
|
||||
// nID - Specifies the date and time picker control's
|
||||
// control ID.
|
||||
// Returns: Nonzero if creation was successful, otherwise returns 0.
|
||||
// Summary: This member function creates the date and time picker control and
|
||||
// attaches it to the CXTDateTimeCtrl object.
|
||||
BOOL Create(DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID);
|
||||
|
||||
// Input: iColor - An int value specifying which color area of the month calendar
|
||||
// to retrieve. For a list of values, see the 'iColor' parameter for
|
||||
// SetMonthCalColor.
|
||||
// Returns: A COLORREF value that represents the color setting for the specified
|
||||
// portion of the month calendar control if successful. The function
|
||||
// returns -1 if unsuccessful.
|
||||
// Summary: This member function retrieves the color for a given portion of
|
||||
// the month calendar within the date and time picker control.
|
||||
COLORREF GetMonthCalColor(int iColor) const;
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: iColor - An int value specifying which area of the month calendar
|
||||
// control to set. This value can be one of the following:
|
||||
// [ul]
|
||||
// [li]<b>MCSC_BACKGROUND</b> Set the background color displayed
|
||||
// between months.[/li]
|
||||
// [li]<b>MCSC_MONTHBK</b> Set the background color displayed
|
||||
// within a month.[/li]
|
||||
// [li]<b>MCSC_TEXT</b> Set the color used to display text within
|
||||
// a month.[/li]
|
||||
// [li]<b>MCSC_TITLEBK</b> Set the background color displayed
|
||||
// in the calendar's title.[/li]
|
||||
// [li]<b>MCSC_TITLETEXT</b> Set the color used to display text
|
||||
// within the calendar's title.[/li]
|
||||
// [li]<b>MCSC_TRAILINGTEXT</b> Set the color used to display
|
||||
// header and trailing-day text. Header and trailing days are the
|
||||
// days from the previous and following months that appear on the
|
||||
// current calendar.[/li]
|
||||
// [/ul]
|
||||
// ref - A RGB value representing the color that will be set
|
||||
// for the specified area of the month calendar.
|
||||
// Returns: A COLORREF value that represents the previous color setting for the specified
|
||||
// portion of the month calendar control if successful. Otherwise, the
|
||||
// message returns -1.
|
||||
// Summary: This member function sets the color for a given portion of the month
|
||||
// calendar within a date and time picker control. Returns
|
||||
COLORREF SetMonthCalColor(int iColor,COLORREF ref);
|
||||
|
||||
// Input: pstrFormat - A pointer to a zero-terminated format string that
|
||||
// defines the desired display. Setting this parameter to
|
||||
// NULL will reset the control to the default format
|
||||
// string for the current style.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function sets the display of a date and time picker
|
||||
// control based on a given format string.
|
||||
BOOL SetFormat(LPCTSTR pstrFormat);
|
||||
|
||||
// Returns: A pointer to a DDX_XTMonthCalCtrl object,
|
||||
// or NULL if unsuccessful or the window is not visible.
|
||||
// Summary: This member function retrieves the date and time picker's child
|
||||
// month calendar control.
|
||||
CXTMonthCalCtrl* GetMonthCalCtrl() const;
|
||||
|
||||
// Returns: A pointer to a CFont object, or returns NULL if unsuccessful.
|
||||
// Summary: This member function retrieves the font currently used by the date
|
||||
// and time picker control's child month calendar control.
|
||||
CFont* GetMonthCalFont() const;
|
||||
|
||||
// Input: hFont - Handle to the font that will be set.
|
||||
// bRedraw - Specifies whether the control should be redrawn
|
||||
// immediately upon setting the font. Setting this
|
||||
// parameter to TRUE causes the control to redraw itself.
|
||||
// Summary: This member function sets the font to be used by the date and time
|
||||
// picker control's child month calendar control.
|
||||
void SetMonthCalFont(HFONT hFont,BOOL bRedraw = TRUE);
|
||||
|
||||
// Input: pMinRange - A pointer to a COleDateTime object containing the
|
||||
// earliest time allowed in the CXTDateTimeCtrl object.
|
||||
// pMaxRange - A pointer to a COleDateTime object containing the
|
||||
// latest time allowed in the CXTDateTimeCtrl object.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function sets the minimum and maximum allowable system
|
||||
// times for a date and time picker control.
|
||||
BOOL SetRange(const COleDateTime* pMinRange,const COleDateTime* pMaxRange);
|
||||
|
||||
// Input: pMinRange - A pointer to a CTime object containing the earliest
|
||||
// time allowed in the CXTDateTimeCtrl object.
|
||||
// pMaxRange - A pointer to a CTime object containing the latest
|
||||
// time allowed in the CXTDateTimeCtrl object.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function sets the minimum and maximum allowable system
|
||||
// times for a date and time picker control.
|
||||
BOOL SetRange(const CTime* pMinRange,const CTime* pMaxRange);
|
||||
|
||||
// Input: pMinRange - A pointer to a CTime object containing the earliest
|
||||
// time allowed in the CXTDateTimeCtrl object.
|
||||
// pMaxRange - A pointer to a CTime object containing the latest
|
||||
// time allowed in the CXTDateTimeCtrl object.
|
||||
// Returns: A DWORD value containing flags that indicate which ranges are set.
|
||||
// Summary: This member function retrieves the current minimum and maximum allowable
|
||||
// system times for a date and time picker control. Returns
|
||||
DWORD GetRange(COleDateTime* pMinRange,COleDateTime* pMaxRange) const;
|
||||
|
||||
// Input: pMinRange - A pointer to a CTime object containing the earliest
|
||||
// time allowed in the CXTDateTimeCtrl object.
|
||||
// pMaxRange - A pointer to a CTime object containing the latest
|
||||
// time allowed in the CXTDateTimeCtrl object.
|
||||
// Returns: A DWORD value containing flags that indicate which ranges are set.
|
||||
// Summary: This member function retrieves the current minimum and maximum allowable
|
||||
// system times for a date and time picker control.
|
||||
DWORD GetRange(CTime* pMinRange,CTime* pMaxRange) const;
|
||||
|
||||
// Input: pTimeNew - A pointer to a CTime object containing the time to
|
||||
// which the control will be set.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function sets the time in a date and time picker control.
|
||||
BOOL SetTime(const CTime* pTimeNew);
|
||||
|
||||
// Input: timeNew - A reference to a COleDateTime object containing the time to
|
||||
// which the control will be set.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function sets the time in a date and time picker control.
|
||||
BOOL SetTime(const COleDateTime& timeNew);
|
||||
|
||||
// Input: pTimeNew - A pointer to a SYSTEMTIME structure containing
|
||||
// the time to which the control will be set.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function sets the time in a date and time picker control.
|
||||
BOOL SetTime(LPSYSTEMTIME pTimeNew = NULL);
|
||||
|
||||
// Input: timeDest - A reference to a CTime object that will receive
|
||||
// the system time information.
|
||||
// Returns: A DWORD value equal to the dwFlag member set in the NMDATETIMECHANGE
|
||||
// structure.
|
||||
// Summary: This member function retrieves the currently selected time from
|
||||
// a date and time picker control and places it in a specified SYSTEMTIME
|
||||
// structure.
|
||||
DWORD GetTime(CTime& timeDest) const;
|
||||
|
||||
// Input: timeDest - A reference to a COleDateTime object that will
|
||||
// receive the system time information.
|
||||
// Returns: Nonzero if the time is successfully written to the
|
||||
// COleDateTime object, otherwise returns zero.
|
||||
// Summary: This member function retrieves the currently selected time from
|
||||
// a date and time picker control and places it in a specified SYSTEMTIME
|
||||
// structure.
|
||||
BOOL GetTime(COleDateTime& timeDest) const;
|
||||
|
||||
// Input: pTimeDest - A pointer to the SYSTEMTIME structure to receive
|
||||
// the system time information. Must not be NULL.
|
||||
// Returns: A DWORD value equal to the dwFlag member set in the NMDATETIMECHANGE
|
||||
// structure.
|
||||
// Summary: This member function retrieves the currently selected time from
|
||||
// a date and time picker control and places it in a specified SYSTEMTIME
|
||||
// structure.
|
||||
DWORD GetTime(LPSYSTEMTIME pTimeDest) const;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE CXTDateTimeCtrl::CXTDateTimeCtrl() {
|
||||
|
||||
}
|
||||
AFX_INLINE CFont* CXTDateTimeCtrl::GetMonthCalFont() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return CFont::FromHandle((HFONT) ::SendMessage(m_hWnd, DTM_GETMCFONT, 0, 0));
|
||||
}
|
||||
AFX_INLINE CXTMonthCalCtrl* CXTDateTimeCtrl::GetMonthCalCtrl() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (CXTMonthCalCtrl*) CWnd::FromHandle((HWND) ::SendMessage(m_hWnd, DTM_GETMONTHCAL, 0, 0));
|
||||
}
|
||||
AFX_INLINE void CXTDateTimeCtrl::SetMonthCalFont(HFONT hFont, BOOL bRedraw /* = TRUE */) {
|
||||
ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, DTM_SETMCFONT, (WPARAM) hFont, MAKELONG(bRedraw, 0));
|
||||
}
|
||||
AFX_INLINE COLORREF CXTDateTimeCtrl::SetMonthCalColor(int iColor, COLORREF ref) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, DTM_SETMCCOLOR, (WPARAM) iColor, (LPARAM) ref);
|
||||
}
|
||||
AFX_INLINE DWORD CXTDateTimeCtrl::GetTime(LPSYSTEMTIME pTimeDest) const {
|
||||
ASSERT(::IsWindow(m_hWnd)); ASSERT(pTimeDest != NULL); return (DWORD) ::SendMessage(m_hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM) pTimeDest);
|
||||
}
|
||||
AFX_INLINE COLORREF CXTDateTimeCtrl::GetMonthCalColor(int iColor) const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, DTM_GETMCCOLOR, (WPARAM) iColor, 0);
|
||||
}
|
||||
AFX_INLINE BOOL CXTDateTimeCtrl::SetFormat(LPCTSTR pstrFormat) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, DTM_SETFORMAT, 0, (LPARAM) pstrFormat);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTMonthCalCtrl is a CWnd derived class. A CXTMonthCalCtrl object encapsulates
|
||||
// the functionality of a month calendar control. The month calendar control
|
||||
// provides the user with a simple calendar interface, from which the user
|
||||
// can select a date. The user can change the display by:
|
||||
// [ul]
|
||||
// [li]Scrolling backward and forward, from month to month.[/li]
|
||||
// [li]Clicking the Today text to display the current day (if the MCS_NOTODAY
|
||||
// style is not used).[/li]
|
||||
// [li]Picking a month or a year from a popup menu.[/li]
|
||||
// [/ul]
|
||||
// You can customize the month calendar control by applying a variety of
|
||||
// styles to the object when you create it. These styles are described
|
||||
// in Month Calendar Control Styles in the Platform SDK.
|
||||
//
|
||||
// The month calendar control can display more than one month, and it can
|
||||
// indicate special days, such as holidays, by bolding the date.
|
||||
//
|
||||
// For more information on using the month calendar control, see Using
|
||||
// CXTMonthCalCtrl in the Xtreme Toolkit online help.
|
||||
class _XT_EXT_CLASS CXTMonthCalCtrl : public CWnd
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTMonthCalCtrl)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTMonthCalCtrl object.
|
||||
CXTMonthCalCtrl();
|
||||
|
||||
// Summary: Destroys a CXTMonthCalCtrl object, handles cleanup and de-allocation.
|
||||
virtual ~CXTMonthCalCtrl();
|
||||
|
||||
// Input: dwStyle - Specifies the combination of Windows styles applied to the month
|
||||
// calendar control. See Month Calendar Control Styles in the Platform
|
||||
// SDK for more information about the styles.
|
||||
// rect - A reference to a RECT structure. Contains the position
|
||||
// and size of the month calendar control
|
||||
// pParentWnd - A pointer to a CWnd object that is the parent window
|
||||
// of the month calendar control. It must not be NULL.
|
||||
// nID - Specifies the month calendar control<6F>s control ID.
|
||||
// Returns: Nonzero if initialization was successful, otherwise returns zero.
|
||||
// Summary: This member function creates a month calendar control and attaches
|
||||
// it to the DDX_XTMonthCalCtrl object.
|
||||
BOOL Create(DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID);
|
||||
|
||||
// Input: dwStyle - Specifies the combination of Windows styles applied to the month
|
||||
// calendar control. See Month Calendar Control Styles in the Platform
|
||||
// SDK for more information about the styles.
|
||||
// pt - A reference to a POINT structure that identifies the location
|
||||
// of the month calendar control.
|
||||
// pParentWnd - A pointer to a CWnd object that is the parent window
|
||||
// of the month calendar control. It must not be NULL.
|
||||
// nID - Specifies the month calendar control<6F>s control ID.
|
||||
// Returns: Nonzero if initialization was successful, otherwise returns zero.
|
||||
// Summary: This member function creates a month calendar control and attaches
|
||||
// it to the DDX_XTMonthCalCtrl object.
|
||||
BOOL Create(DWORD dwStyle,const POINT& pt,CWnd* pParentWnd,UINT nID);
|
||||
|
||||
// Input: pRect - A pointer to a RECT structure that will receive
|
||||
// bounding rectangle information. This parameter must be a valid
|
||||
// address and cannot be NULL.
|
||||
// Returns: Nonzero and 'lpRect' receives the applicable bounding information. If
|
||||
// unsuccessful, this member function returns zero.
|
||||
// Summary: This member function retrieves the minimum size required to show
|
||||
// a full month in a month calendar control.
|
||||
BOOL GetMinReqRect(RECT* pRect) const;
|
||||
|
||||
// Input: iDelta - The number of months to be set as the control's scroll rate.
|
||||
// If this value is zero, the month delta is reset to the default, which
|
||||
// is the number of months displayed in the control.
|
||||
// Returns: The previous scroll rate. If the scroll rate has not been previously
|
||||
// set, the return value is zero.
|
||||
// Summary: This member function sets the scroll rate for a month calendar control.
|
||||
int SetMonthDelta(int iDelta);
|
||||
|
||||
// Returns: An integer value that represents the scroll rate for the month calendar
|
||||
// control.
|
||||
// Summary: This member function retrieves the scroll rate for a month calendar
|
||||
// control. The scroll rate is the number of months that the control
|
||||
// moves its display when the user clicks a scroll button once.
|
||||
int GetMonthDelta() const;
|
||||
|
||||
// Input: iDay - An integer value representing which day is to be set as the
|
||||
// first day of the week. This value must be one of the day numbers.
|
||||
// See GetFirstDayOfWeek for a description of the day numbers.
|
||||
// lpnOld - A pointer to an integer indicating the first day of
|
||||
// the week previously set.
|
||||
// Returns: Nonzero if the previous first day of the week is set to a value other than
|
||||
// that of LOCALE_IFIRSTDAYOFWEEK, which is the day indicated in the control
|
||||
// panel setting. Otherwise, this function returns zero.
|
||||
// Summary: This member function sets the day of the week to be displayed in
|
||||
// the leftmost column of the calendar.
|
||||
BOOL SetFirstDayOfWeek(int iDay,int* lpnOld = NULL);
|
||||
|
||||
// Input: pbLocal - A pointer to a BOOL value. If the value is nonzero, the control's
|
||||
// setting does not match the setting in the control panel.
|
||||
// Returns: An integer value that represents the first day of the week. The days of the week are
|
||||
// represented by integers, as follows:
|
||||
// <pre>
|
||||
// <b>Value</b> <b>Day of the Week</b>
|
||||
// <b>0</b> <b>Monday</b>
|
||||
// <b>1</b> <b>Tuesday</b>
|
||||
// <b>2</b> <b>Wednesday</b>
|
||||
// <b>3</b> <b>Thursday</b>
|
||||
// <b>4</b> <b>Friday</b>
|
||||
// <b>5</b> <b>Saturday</b>
|
||||
// <b>6</b> <b>Sunday</b>
|
||||
// </pre>
|
||||
// Summary: This member function gets the first day of the week to be displayed
|
||||
// in the left most column of the calendar.
|
||||
int GetFirstDayOfWeek(BOOL* pbLocal = NULL) const;
|
||||
|
||||
// Input: nRegion - The region of the month calendar control from which the color
|
||||
// is retrieved. For a list of values, see the 'nRegion' parameter of SetColor.
|
||||
// Returns: A COLORREF value specifying the color associated
|
||||
// with the portion of the month calendar control, if successful.
|
||||
// Otherwise, this member function returns -1.
|
||||
// Summary: This member function gets the color of a specified area of a month
|
||||
// calendar control.
|
||||
COLORREF GetColor(int nRegion) const;
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: nRegion - An integer value specifying which month calendar color
|
||||
// to set. This value can be one of the following:
|
||||
// [ul]
|
||||
// [li]<b>MCSC_BACKGROUND</b> The background color displayed between
|
||||
// months.[/li]
|
||||
// [li]<b>MCSC_MONTHBK</b> The background color displayed within
|
||||
// the month.[/li]
|
||||
// [li]<b>MCSC_TEXT</b> The color used to display text within a month.[/li]
|
||||
// [li]<b>MCSC_TITLEBK</b> The background color displayed in the
|
||||
// calendar's title.[/li]
|
||||
// [li]<b>MCSC_TITLETEXT</b> The color used to display text within
|
||||
// the calendar's title.[/li]
|
||||
// [li]<b>MCSC_TRAILINGTEXT</b> The color used to display header
|
||||
// and trailing-day text. Header and trailing days are the days
|
||||
// from the previous and following months that appear on the current
|
||||
// calendar.[/li]
|
||||
// [/ul]
|
||||
// ref - A COLORREF value for the new color setting for the specified
|
||||
// portion of the month calendar control.
|
||||
// Returns: A COLORREF value that represents the previous
|
||||
// color setting for the specified portion of the month calendar
|
||||
// control, if successful. Otherwise this message returns -1.
|
||||
// Summary: This member function sets the color of a specified area of a month
|
||||
// calendar control.
|
||||
COLORREF SetColor(int nRegion,COLORREF ref);
|
||||
|
||||
// Input: bRepaint - Specifies whether the control is to be repainted. By default,
|
||||
// TRUE. If FALSE, no repainting occurs.
|
||||
// Returns: Nonzero if the month calendar control is sized to its minimum, otherwise
|
||||
// returns zero.
|
||||
// Summary: This member function repaints the month calendar control to its
|
||||
// minimum, one-month size.
|
||||
BOOL SizeMinReq(BOOL bRepaint = TRUE);
|
||||
|
||||
// Input: refDateTime - A reference to a COleDateTime object that contains the current
|
||||
// date.
|
||||
// Summary: This member function sets the calendar control to the current day.
|
||||
void SetToday(const COleDateTime& refDateTime);
|
||||
|
||||
// Input: pDateTime - A pointer to a CTime object containing the current date
|
||||
// information.
|
||||
// Summary: This member function sets the calendar control to the current day.
|
||||
void SetToday(const CTime* pDateTime);
|
||||
|
||||
// Input: pDateTime - A pointer to a SYSTEMTIME structure that
|
||||
// contains the current date information.
|
||||
// Summary: This member function sets the calendar control to the current day.
|
||||
void SetToday(const LPSYSTEMTIME pDateTime);
|
||||
|
||||
// Input: refTime - A reference to a CTime object indicating the current day.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function retrieves the date information for the date specified
|
||||
// as "today" for a month calendar control.
|
||||
BOOL GetToday(CTime& refTime) const;
|
||||
|
||||
// Input: refDateTime - A reference to a COleDateTime object indicating the current day.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function retrieves the date information for the date specified
|
||||
// as "today" for a month calendar control.
|
||||
BOOL GetToday(COleDateTime& refDateTime) const;
|
||||
|
||||
// Input: pDateTime - A pointer to a SYSTEMTIME structure that
|
||||
// will receive the date information. This parameter must be
|
||||
// a valid address and cannot be NULL.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function retrieves the date information for the date specified
|
||||
// as "today" for a month calendar control.
|
||||
BOOL GetToday(LPSYSTEMTIME pDateTime) const;
|
||||
|
||||
// Input: pDateTime - A pointer to a SYSTEMTIME structure that will receive the currently selected
|
||||
// date information. This parameter must be a valid address and cannot
|
||||
// be NULL.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function retrieves the system time as indicated by the
|
||||
// currently selected date.
|
||||
BOOL GetCurSel(LPSYSTEMTIME pDateTime) const;
|
||||
|
||||
// Input: refDateTime - A reference to a CTime object. It receives the current time.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function retrieves the system time as indicated by the
|
||||
// currently selected date.
|
||||
BOOL GetCurSel(CTime& refDateTime) const;
|
||||
|
||||
// Input: refDateTime - A reference to a COleDateTime object. It receives the current time.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function retrieves the system time as indicated by the
|
||||
// currently selected date.
|
||||
BOOL GetCurSel(COleDateTime& refDateTime) const;
|
||||
|
||||
// Input: pDateTime - Pointer to a SYSTEMTIME structure that contains the date to
|
||||
// be set as the current selection.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function sets the currently selected date for a month calendar
|
||||
// control.
|
||||
BOOL SetCurSel(const LPSYSTEMTIME pDateTime);
|
||||
|
||||
// Input: refDateTime - A reference to a CTime object indicating the currently selected
|
||||
// month calendar control.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function sets the currently selected date for a month calendar
|
||||
// control.
|
||||
BOOL SetCurSel(const CTime& refDateTime);
|
||||
|
||||
// Input: refDateTime - A reference to a COleDateTime indicating the currently selected
|
||||
// month calendar control.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function sets the currently selected date for a month calendar
|
||||
// control.
|
||||
BOOL SetCurSel(const COleDateTime& refDateTime);
|
||||
|
||||
// Input: nMonths - Value indicating how many elements are in the array that 'pStates'
|
||||
// points to.
|
||||
// pStates - A pointer to a MONTHDAYSTATE array of values that define
|
||||
// how the month calendar control will draw each day in its
|
||||
// display. The MONTHDAYSTATE data type is a bit field, where
|
||||
// each bit (1 through 31) represents the state of a day in a
|
||||
// month. If a bit is on, the corresponding day will be displayed
|
||||
// in bold; otherwise it will be displayed with no emphasis.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function sets the display for days in a month calendar control.
|
||||
BOOL SetDayState(int nMonths,LPMONTHDAYSTATE pStates);
|
||||
|
||||
// Input: nMax - Specifies the value that will be set to represent the maximum
|
||||
// number of selectable days.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function sets the maximum number of days that can be selected
|
||||
// in a month calendar control.
|
||||
BOOL SetMaxSelCount(int nMax);
|
||||
|
||||
// Returns: An integer value that represents the total number of days that can be selected
|
||||
// for the control.
|
||||
// Summary: This member function retrieves the current maximum number of days that can
|
||||
// be selected in a month calendar control.
|
||||
int GetMaxSelCount() const;
|
||||
|
||||
// Input: pMinRange - A pointer to a COleDateTime object containing
|
||||
// the date at the lowest end of the range.
|
||||
// pMaxRange - A pointer to a COleDateTime object containing the
|
||||
// date at the highest end of the range.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function sets the minimum and maximum allowable dates for a month
|
||||
// calendar control.
|
||||
BOOL SetRange(const COleDateTime* pMinRange,const COleDateTime* pMaxRange);
|
||||
|
||||
// Input: pMinRange - A pointer to a CTime object containing the date at the lowest
|
||||
// end of the range.
|
||||
// pMaxRange - A pointer to a CTime object containing the date at the highest
|
||||
// end of the range.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function sets the minimum and maximum allowable dates for a month
|
||||
// calendar control.
|
||||
BOOL SetRange(const CTime* pMinRange,const CTime* pMaxRange);
|
||||
|
||||
// Input: pMinRange - A pointer to a SYSTEMTIME structure containing
|
||||
// the date at the lowest end of the range.
|
||||
// pMaxRange - A pointer to a SYSTEMTIME structure containing the
|
||||
// date at the highest end of the range.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function sets the minimum and maximum allowable dates for a month
|
||||
// calendar control.
|
||||
BOOL SetRange(const LPSYSTEMTIME pMinRange,const LPSYSTEMTIME pMaxRange);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: pMinRange - A pointer to a COleDateTime object containing
|
||||
// the date at the lowest end of the range.
|
||||
// pMaxRange - A pointer to a COleDateTime object containing the
|
||||
// date at the highest end of the range.
|
||||
// Returns: A DWORD that can be zero (no limits are set) or a combination
|
||||
// of the following values that specify limit information:
|
||||
// [ul]
|
||||
// [li]<b>GDTR_MAX</b> A maximum limit is set for the control; pMaxRange
|
||||
// is valid and contains the applicable date information.[/li]
|
||||
// [li]<b>GDTR_MIN</b> A minimum limit is set for the control; pMinRange
|
||||
// is valid and contains the applicable date information.[/li]
|
||||
// [/ul]
|
||||
// Summary: This member function retrieves the current minimum and maximum dates set
|
||||
// in a month calendar control.
|
||||
DWORD GetRange(COleDateTime* pMinRange,COleDateTime* pMaxRange) const;
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: pMinRange - A pointer to a CTime object containing the date at the lowest
|
||||
// end of the range.
|
||||
// pMaxRange - A pointer to a CTime object containing the date at the highest
|
||||
// end of the range.
|
||||
// Returns: A DWORD that can be zero (no limits are set) or a combination
|
||||
// of the following values that specify limit information:
|
||||
// [ul]
|
||||
// [li]<b>GDTR_MAX</b> A maximum limit is set for the control; pMaxRange
|
||||
// is valid and contains the applicable date information.[/li]
|
||||
// [li]<b>GDTR_MIN</b> A minimum limit is set for the control; pMinRange
|
||||
// is valid and contains the applicable date information.[/li]
|
||||
// [/ul]
|
||||
// Summary: This member function retrieves the current minimum and maximum dates set
|
||||
// in a month calendar control.
|
||||
DWORD GetRange(CTime* pMinRange,CTime* pMaxRange) const;
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: pMinRange - A pointer to a SYSTEMTIME structure containing
|
||||
// the date at the lowest end of the range.
|
||||
// pMaxRange - A pointer to a COleDateTime object, a CTime object,
|
||||
// or SYSTEMTIME structure containing the date at the highest
|
||||
// end of the range.
|
||||
// Returns: A DWORD that can be zero (no limits are set) or a combination
|
||||
// of the following values that specify limit information:
|
||||
// [ul]
|
||||
// [li]<b>GDTR_MAX</b> A maximum limit is set for the control; pMaxRange
|
||||
// is valid and contains the applicable date information.[/li]
|
||||
// [li]<b>GDTR_MIN</b> A minimum limit is set for the control; pMinRange
|
||||
// is valid and contains the applicable date information.[/li]
|
||||
// [/ul]
|
||||
// Summary: This member function retrieves the current minimum and maximum dates set
|
||||
// in a month calendar control.
|
||||
DWORD GetRange(LPSYSTEMTIME pMinRange,LPSYSTEMTIME pMaxRange) const;
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: refMinRange - A reference to a COleDateTime object
|
||||
// containing the minimum date allowed.
|
||||
// refMaxRange - A reference to a COleDateTime object containing
|
||||
// the maximum date allowed.
|
||||
// dwFlags - Value specifying the scope of the range limits to
|
||||
// be retrieved. This value must be one of the following:
|
||||
// [ul]
|
||||
// [li]<b>GMR_DAYSTATE</b> Include preceding and trailing months
|
||||
// of visible range that are only partially displayed.[/li]
|
||||
// [li]<b>GMR_VISIBLE</b> Include only those months that are entirely
|
||||
// displayed.[/li]
|
||||
// [/ul]
|
||||
// Returns: An integer that represents the range, in months, spanned by the two
|
||||
// limits indicated by 'refMinRange' and 'refMaxRange'.
|
||||
// Summary: This member function retrieves date information representing the
|
||||
// high and low limits of a month calendar control's display.
|
||||
int GetMonthRange(COleDateTime& refMinRange,COleDateTime& refMaxRange,DWORD dwFlags) const;
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: refMinRange - A reference to a CTime object containing the minimum date allowed.
|
||||
// refMaxRange - A reference to a CTime object containing the maximum date allowed.
|
||||
// dwFlags - Value specifying the scope of the range limits to
|
||||
// be retrieved. This value must be one of the following:
|
||||
// [ul]
|
||||
// [li]<b>GMR_DAYSTATE</b> Include preceding and trailing months
|
||||
// of visible range that are only partially displayed.[/li]
|
||||
// [li]<b>GMR_VISIBLE</b> Include only those months that are entirely
|
||||
// displayed.[/li]
|
||||
// [/ul]
|
||||
// Returns: An integer that represents the range, in months, spanned by the two
|
||||
// limits indicated by 'refMinRange' and 'refMaxRange'.
|
||||
// Summary: This member function retrieves date information representing the
|
||||
// high and low limits of a month calendar control's display.
|
||||
int GetMonthRange(CTime& refMinRange,CTime& refMaxRange,DWORD dwFlags) const;
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: pMaxRange - A pointer to a SYSTEMTIME structure containing the date at the
|
||||
// lowest end of the range.
|
||||
// pMaxRange - A pointer to a SYSTEMTIME structure containing the date at the
|
||||
// highest end of the range.
|
||||
// dwFlags - Value specifying the scope of the range limits to
|
||||
// be retrieved. This value must be one of the following:
|
||||
// [ul]
|
||||
// [li]<b>GMR_DAYSTATE</b> Include preceding and trailing months
|
||||
// of visible range that are only partially displayed.[/li]
|
||||
// [li]<b>GMR_VISIBLE</b> Include only those months that are entirely
|
||||
// displayed.[/li]
|
||||
// [/ul]
|
||||
// Returns: An integer that represents the range, in months, spanned by the two
|
||||
// limits indicated by 'refMinRange' and 'refMaxRange'.
|
||||
// Summary: This member function retrieves date information representing the
|
||||
// high and low limits of a month calendar control's display.
|
||||
int GetMonthRange(LPSYSTEMTIME pMinRange,LPSYSTEMTIME pMaxRange,DWORD dwFlags) const;
|
||||
|
||||
// Input: pMinRange - A pointer to a COleDateTime object containing
|
||||
// the date at the lowest end of the range.
|
||||
// pMaxRange - A pointer to a COleDateTime object containing the
|
||||
// date at the highest end of the range.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function sets the selection for a month calendar control
|
||||
// to a given date range.
|
||||
BOOL SetSelRange(const COleDateTime& pMinRange,const COleDateTime& pMaxRange);
|
||||
|
||||
// Input: pMinRange - A pointer to a CTime object containing the date at the lowest
|
||||
// end of the range.
|
||||
// pMaxRange - A pointer to a CTime object containing the date at the highest
|
||||
// end of the range.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function sets the selection for a month calendar control
|
||||
// to a given date range.
|
||||
BOOL SetSelRange(const CTime& pMinRange,const CTime& pMaxRange);
|
||||
|
||||
// Input: pMinRange - A pointer to a SYSTEMTIME structure containing the date at the
|
||||
// lowest end of the range.
|
||||
// pMaxRange - A pointer to a SYSTEMTIME structure containing the date at the
|
||||
// highest end of the range.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function sets the selection for a month calendar control
|
||||
// to a given date range.
|
||||
BOOL SetSelRange(const LPSYSTEMTIME pMinRange,const LPSYSTEMTIME pMaxRange);
|
||||
|
||||
// Input: refMinRange - A reference to a COleDateTime object containing the minimum
|
||||
// date allowed.
|
||||
// refMaxRange - A reference to a COleDateTime object containing the maximum
|
||||
// date allowed.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function retrieves date information representing the
|
||||
// upper and lower limits of the date range currently selected by the
|
||||
// user.
|
||||
BOOL GetSelRange(COleDateTime& refMinRange,COleDateTime& refMaxRange) const;
|
||||
|
||||
// Input: refMinRange - A reference to a CTime object containing the minimum date
|
||||
// allowed.
|
||||
// refMaxRange - A reference to a CTime object containing the maximum date
|
||||
// allowed.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function retrieves date information representing the
|
||||
// upper and lower limits of the date range currently selected by the
|
||||
// user.
|
||||
BOOL GetSelRange(CTime& refMinRange,CTime& refMaxRange) const;
|
||||
|
||||
// Input: pMinRange - A pointer to a SYSTEMTIME structure containing
|
||||
// the date at the lowest end of the range.
|
||||
// pMaxRange - A pointer to a SYSTEMTIME structure containing the
|
||||
// date at the highest end of the range.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function retrieves date information representing the
|
||||
// upper and lower limits of the date range currently selected by the
|
||||
// user.
|
||||
BOOL GetSelRange(LPSYSTEMTIME pMinRange,LPSYSTEMTIME pMaxRange) const;
|
||||
|
||||
// Input: pMCHitTest - A pointer to a MCHITTESTINFO structure containing hit testing
|
||||
// points for the month calendar control.
|
||||
// Returns: A DWORD value equal to the 'uHit' member of the MCHITTESTINFO structure.
|
||||
// Summary: This member function determines which portion of a month calendar
|
||||
// control is at a given point on the screen.
|
||||
DWORD HitTest(PMCHITTESTINFO pMCHitTest);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE CXTMonthCalCtrl::CXTMonthCalCtrl() {
|
||||
|
||||
}
|
||||
AFX_INLINE DWORD CXTMonthCalCtrl::HitTest(PMCHITTESTINFO pMCHitTest) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, MCM_HITTEST, 0, (LPARAM) pMCHitTest);
|
||||
}
|
||||
AFX_INLINE BOOL CXTMonthCalCtrl::GetMinReqRect(RECT* pRect) const {
|
||||
ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_GETMINREQRECT, 0, (LPARAM) pRect);
|
||||
}
|
||||
AFX_INLINE int CXTMonthCalCtrl::SetMonthDelta(int iDelta) {
|
||||
ASSERT(m_hWnd != NULL); return (int) ::SendMessage(m_hWnd, MCM_SETMONTHDELTA, (WPARAM) iDelta, 0);
|
||||
}
|
||||
AFX_INLINE int CXTMonthCalCtrl::GetMonthDelta() const {
|
||||
ASSERT(m_hWnd != NULL); return (int) ::SendMessage(m_hWnd, MCM_GETMONTHDELTA, 0, 0);
|
||||
}
|
||||
AFX_INLINE COLORREF CXTMonthCalCtrl::GetColor(int nRegion) const {
|
||||
ASSERT(m_hWnd != NULL); return (COLORREF) ::SendMessage(m_hWnd, MCM_GETCOLOR, (WPARAM) nRegion, 0);
|
||||
}
|
||||
AFX_INLINE COLORREF CXTMonthCalCtrl::SetColor(int nRegion, COLORREF ref) {
|
||||
ASSERT(m_hWnd != NULL); return (COLORREF) ::SendMessage(m_hWnd, MCM_SETCOLOR, (WPARAM) nRegion, (LPARAM) ref);
|
||||
}
|
||||
AFX_INLINE BOOL CXTMonthCalCtrl::SetMaxSelCount(int nMax) {
|
||||
ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_SETMAXSELCOUNT, nMax, 0);
|
||||
}
|
||||
AFX_INLINE int CXTMonthCalCtrl::GetMaxSelCount() const {
|
||||
ASSERT(m_hWnd != NULL); return (int) ::SendMessage(m_hWnd, MCM_GETMAXSELCOUNT, 0, 0);
|
||||
}
|
||||
AFX_INLINE void CXTMonthCalCtrl::SetToday(const LPSYSTEMTIME pDateTime) {
|
||||
ASSERT(m_hWnd != NULL); ::SendMessage(m_hWnd, MCM_SETTODAY, 0, (LPARAM) pDateTime);
|
||||
}
|
||||
AFX_INLINE BOOL CXTMonthCalCtrl::GetToday(LPSYSTEMTIME pDateTime) const {
|
||||
ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_GETTODAY, 0, (LPARAM) pDateTime);
|
||||
}
|
||||
AFX_INLINE BOOL CXTMonthCalCtrl::SetCurSel(const LPSYSTEMTIME pDateTime) {
|
||||
ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_SETCURSEL, 0, (LPARAM) pDateTime);
|
||||
}
|
||||
AFX_INLINE BOOL CXTMonthCalCtrl::GetCurSel(LPSYSTEMTIME pDateTime) const {
|
||||
ASSERT(m_hWnd != NULL); return (BOOL) ::SendMessage(m_hWnd, MCM_GETCURSEL, 0, (LPARAM) pDateTime);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTDATETIMECTRL_H__)
|
||||
1500
Editor/XT/Include/XTDefines.h
Normal file
1500
Editor/XT/Include/XTDefines.h
Normal file
File diff suppressed because it is too large
Load Diff
261
Editor/XT/Include/XTDelegate.h
Normal file
261
Editor/XT/Include/XTDelegate.h
Normal file
@@ -0,0 +1,261 @@
|
||||
// XTDelegate.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTDELEGATE_H__)
|
||||
#define __XTDELEGATE_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
// Summary: A base class for delegates defined here
|
||||
template <class TCallback>
|
||||
class CXTDelegateBase
|
||||
{
|
||||
public:
|
||||
typedef TCallback CB;
|
||||
|
||||
protected:
|
||||
|
||||
CB m_cb; // A callback.
|
||||
CObject* m_target; // A target on which to invoke the callback.
|
||||
|
||||
public:
|
||||
CXTDelegateBase(CObject* target, CB cb)
|
||||
: m_target(target)
|
||||
, m_cb(cb)
|
||||
{ }
|
||||
|
||||
operator bool () const
|
||||
{
|
||||
return m_target != 0 && m_cb != 0;
|
||||
}
|
||||
|
||||
void Set(CObject* target, CB cb)
|
||||
{
|
||||
m_target = target;
|
||||
m_cb = cb;
|
||||
}
|
||||
|
||||
bool Remove(CObject* target)
|
||||
{
|
||||
bool removed = m_target == target;
|
||||
if (removed)
|
||||
{
|
||||
m_target = 0;
|
||||
m_cb = 0;
|
||||
}
|
||||
return removed;
|
||||
}
|
||||
|
||||
bool Remove(CObject* target, CB cb)
|
||||
{
|
||||
bool removed = (m_target == target) && (m_cb == cb);
|
||||
if (removed)
|
||||
{
|
||||
m_target = 0;
|
||||
m_cb = 0;
|
||||
}
|
||||
return removed;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Summary: No parameters, void return.
|
||||
class CXTDelegate0 : public CXTDelegateBase<void (CObject::*)()>
|
||||
{
|
||||
public:
|
||||
CXTDelegate0(CObject* target = 0, CB cb = 0)
|
||||
: CXTDelegateBase<CB>(target, cb)
|
||||
{}
|
||||
|
||||
void operator () () const
|
||||
{
|
||||
(m_target->*m_cb)();
|
||||
}
|
||||
};
|
||||
|
||||
// Summary: One parameter, void return.
|
||||
template <class TParam>
|
||||
class CXTDelegate1 : public CXTDelegateBase<void (CObject::*)(TParam)>
|
||||
{
|
||||
public:
|
||||
CXTDelegate1(CObject* target = 0, CB cb = 0)
|
||||
: CXTDelegateBase<CB>(target, cb)
|
||||
{}
|
||||
|
||||
void operator () (TParam param) const
|
||||
{
|
||||
(m_target->*m_cb)(param);
|
||||
}
|
||||
};
|
||||
|
||||
// Summary: One parameter, typed return.
|
||||
template <class TReturn, class TParam>
|
||||
class CXTDelegate1Ret : public CXTDelegateBase<TReturn (CObject::*)(TParam)>
|
||||
{
|
||||
public:
|
||||
CXTDelegate1Ret(CObject* target = 0, CB cb = 0)
|
||||
: CXTDelegateBase<CB>(target, cb)
|
||||
{}
|
||||
|
||||
TReturn operator () (TParam param) const
|
||||
{
|
||||
return (m_target->*m_cb)(param);
|
||||
}
|
||||
};
|
||||
|
||||
// Summary: Two parameters, void return.
|
||||
template <class TParam1, class TParam2>
|
||||
class CXTDelegate2 : public CXTDelegateBase<void (CObject::*)(TParam1, TParam2)>
|
||||
{
|
||||
public:
|
||||
CXTDelegate2(CObject* target = 0, CB cb = 0)
|
||||
: CXTDelegateBase<CB>(target, cb)
|
||||
{}
|
||||
|
||||
void operator () (TParam1 param1, TParam2 param2) const
|
||||
{
|
||||
(m_target->*m_cb)(param1, param2);
|
||||
}
|
||||
};
|
||||
|
||||
// Summary: Two parameters, returns a type.
|
||||
template <class TReturn, class TParam1, class TParam2>
|
||||
class CXTDelegate2Ret : public CXTDelegateBase<TReturn (CObject::*)(TParam1, TParam2)>
|
||||
{
|
||||
public:
|
||||
CXTDelegate2Ret(CObject* target = 0, CB cb = 0)
|
||||
: CXTDelegateBase<CB>(target, cb)
|
||||
{}
|
||||
|
||||
TReturn operator () (TParam1 param1, TParam2 param2) const
|
||||
{
|
||||
return (m_target->*m_cb)(param1, param2);
|
||||
}
|
||||
};
|
||||
|
||||
// Summary: A multicast delegate.
|
||||
template <class TDelegate>
|
||||
class CXTMultiCastDelegate : public CArray<TDelegate, const TDelegate&>
|
||||
{
|
||||
public:
|
||||
|
||||
#if _MSC_VER < 1200 // MFC 5.0
|
||||
typedef TDelegate DELEGATE;
|
||||
typedef DELEGATE::CB CB;
|
||||
#else
|
||||
typedef typename TDelegate DELEGATE;
|
||||
typedef typename DELEGATE::CB CB;
|
||||
#endif
|
||||
|
||||
// Input: target - Points to a CObject object.
|
||||
// Summary: Removes all registrations for a target.
|
||||
void Remove(CObject* target)
|
||||
{
|
||||
for (int i = GetUpperBound(); i >= 0; i--)
|
||||
{
|
||||
if (ElementAt(i).Remove(target))
|
||||
{
|
||||
RemoveAt(i);
|
||||
}
|
||||
}
|
||||
ReleaseMemory();
|
||||
}
|
||||
|
||||
// Summary: Frees up the memory once there is nothing in the array.
|
||||
void ReleaseMemory()
|
||||
{
|
||||
if (GetSize() == 0)
|
||||
{
|
||||
FreeExtra();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Input: target - Points to a CObject object.
|
||||
// cb - delegate
|
||||
// Summary: removes all registrations for a target.
|
||||
void Remove(CObject* target, CB cb)
|
||||
{
|
||||
for (INT_PTR i = GetUpperBound(); i >= 0; i--)
|
||||
{
|
||||
if (ElementAt(i).Remove(target, cb))
|
||||
{
|
||||
RemoveAt(i);
|
||||
}
|
||||
}
|
||||
ReleaseMemory();
|
||||
}
|
||||
|
||||
// Input: target - Pointst to a CObject object.
|
||||
// cb - delegate.
|
||||
// Returns: Index into array where callback was added.
|
||||
// Summary: Adds new callback.
|
||||
int Add(CObject* target, CB cb)
|
||||
{
|
||||
return CArray<TDelegate, const TDelegate&>::Add(DELEGATE(target, cb));
|
||||
}
|
||||
};
|
||||
|
||||
// Summary: No-parameter delegate.
|
||||
class CXTMultiCastDelegate0 : public CXTMultiCastDelegate<CXTDelegate0>
|
||||
{
|
||||
public:
|
||||
void operator() ()
|
||||
{
|
||||
for (int i = 0; i < GetSize(); i++)
|
||||
{
|
||||
CXTDelegate0& delegate = ElementAt(i);
|
||||
delegate();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Summary: One parameter delegate.
|
||||
template <class TParam>
|
||||
class CXTMultiCastDelegate1 : public CXTMultiCastDelegate< CXTDelegate1<TParam> >
|
||||
{
|
||||
public:
|
||||
void operator() (TParam param)
|
||||
{
|
||||
for (int i = 0; i < GetSize(); i++)
|
||||
{
|
||||
const CXTDelegate1<TParam>& delegate = ElementAt(i);
|
||||
delegate(param);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Summary: Two parameter delegate.
|
||||
template <class TParam1, class TParam2>
|
||||
class CXTMultiCastDelegate2 : public CXTMultiCastDelegate< CXTDelegate2<TParam1, TParam2> >
|
||||
{
|
||||
public:
|
||||
void operator() (TParam1 param1, TParam2 param2)
|
||||
{
|
||||
for (int i = 0; i < GetSize(); i++)
|
||||
{
|
||||
const CXTDelegate2<TParam1, TParam2>& delegate = ElementAt(i);
|
||||
delegate(param1, param2);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#endif
|
||||
// __XTDELEGATE_H__
|
||||
162
Editor/XT/Include/XTDialogBar.h
Normal file
162
Editor/XT/Include/XTDialogBar.h
Normal file
@@ -0,0 +1,162 @@
|
||||
// XTDialogBar.h interface for the CXTDialogBar class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTDIALOGBAR_H__)
|
||||
#define __XTDIALOGBAR_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: The CXTDialogBar class provides the functionality of a Windows modeless
|
||||
// dialog box in a control bar. A dialog bar resembles a dialog box in
|
||||
// that it contains standard Windows controls that the user can tab between.
|
||||
// Another similarity is that you create a dialog template to represent
|
||||
// the dialog bar.
|
||||
//
|
||||
// Creating and using a dialog bar is similar to creating and using a CFormView
|
||||
// object. First, use the dialog editor (described in the MSDN Visual C++
|
||||
// User's Guide) to define a dialog template with the style WS_CHILD and
|
||||
// no other style. The template must not have the style WS_VISIBLE. In
|
||||
// your application code, call the constructor to construct the CXTDialogBar
|
||||
// object, then call Create to create the dialog bar window and attach
|
||||
// it to the CXTDialogBar object.
|
||||
class _XT_EXT_CLASS CXTDialogBar : public CXTControlBar
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTDialogBar)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTDialogBar object.
|
||||
CXTDialogBar();
|
||||
|
||||
// Summary: Destroys a CXTDialogBar object, handles cleanup and de-allocation.
|
||||
virtual ~CXTDialogBar();
|
||||
|
||||
protected:
|
||||
|
||||
CWnd* m_pParentWnd; // Points to the parent window.
|
||||
CSize m_sizeDefault; // Default size of the dialog bar.
|
||||
|
||||
public:
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: pParentWnd - A pointer to the parent CWnd object.
|
||||
// lpszTemplateName - A pointer to the name of the CXTDialogBar
|
||||
// object<63>s dialog box resource template.
|
||||
// nStyle - The alignment style of the dialog bar. The
|
||||
// following styles are supported:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_TOP</b> Control bar is at the top of the frame
|
||||
// window.[/li]
|
||||
// [li]<b>CBRS_BOTTOM</b> Control bar is at the bottom of the
|
||||
// frame window.[/li]
|
||||
// [li]<b>CBRS_NOALIGN</b> Control bar is not repositioned when
|
||||
// the parent is resized.[/li]
|
||||
// [li]<b>CBRS_LEFT</b> Control bar is at the left of the frame
|
||||
// window.[/li]
|
||||
// [li]<b>CBRS_RIGHT</b> Control bar is at the right of the frame
|
||||
// window.[/li]
|
||||
// [/ul]
|
||||
// nID - The control ID of the dialog bar.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function loads the dialog box resource template specified
|
||||
// by 'lpszTemplateName'. It creates the dialog bar window, sets
|
||||
// its style, and associates it with the CXTDialogBar object.
|
||||
//
|
||||
// If you specify the CBRS_TOP or CBRS_BOTTOM alignment style, the
|
||||
// dialog bar<61>s width is that of the frame window and its height is
|
||||
// that of the resource specified by 'lpszTemplateName'. If you specify the
|
||||
// CBRS_LEFT or CBRS_RIGHT alignment style, the dialog bar<61>s height is
|
||||
// that of the frame window and its width is that of the resource
|
||||
// specified by 'lpszTemplateName'.
|
||||
virtual BOOL Create(CWnd* pParentWnd,LPCTSTR lpszTemplateName,UINT nStyle = CBRS_ALIGN_TOP,UINT_PTR nID = AFX_IDW_DIALOGBAR);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: pParentWnd - A pointer to the parent CWnd object.
|
||||
// nIDTemplate - The resource ID of the CXTDialogBar object<63>s
|
||||
// dialog box template.
|
||||
// nStyle - The alignment style of the dialog bar. The
|
||||
// following styles are supported:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_TOP</b> Control bar is at the top of the frame
|
||||
// window.[/li]
|
||||
// [li]<b>CBRS_BOTTOM</b> Control bar is at the bottom of the
|
||||
// frame window.[/li]
|
||||
// [li]<b>CBRS_NOALIGN</b> Control bar is not repositioned when
|
||||
// the parent is resized.[/li]
|
||||
// [li]<b>CBRS_LEFT</b> Control bar is at the left of the frame
|
||||
// window.[/li]
|
||||
// [li]<b>CBRS_RIGHT</b> Control bar is at the right of frame
|
||||
// window.[/li]
|
||||
// [/ul]
|
||||
// nID - The control ID of the dialog bar.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function loads the dialog box resource template specified
|
||||
// by 'nIDTemplate'. It creates the dialog bar window, sets
|
||||
// its style, and associates it with the CXTDialogBar object.
|
||||
//
|
||||
// If you specify the CBRS_TOP or CBRS_BOTTOM alignment style, the
|
||||
// dialog bar<61>s width is that of the frame window and its height is
|
||||
// that of the resource specified by 'nIDTemplate'. If you specify the
|
||||
// CBRS_LEFT or CBRS_RIGHT alignment style, the dialog bar<61>s height is
|
||||
// that of the frame window and its width is that of the resource
|
||||
// specified by 'nIDTemplate'.
|
||||
virtual BOOL Create(CWnd* pParentWnd,UINT nIDTemplate,UINT nStyle = CBRS_ALIGN_TOP,UINT nID = AFX_IDW_DIALOGBAR);
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTDialogBar)
|
||||
virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
|
||||
virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
#ifndef _AFX_NO_OCC_SUPPORT
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Data and functions necessary for OLE control containment
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
_AFX_OCC_DIALOG_INFO* m_pOccDialogInfo;
|
||||
LPCTSTR m_lpszTemplateName;
|
||||
|
||||
virtual BOOL SetOccDialogInfo(
|
||||
_AFX_OCC_DIALOG_INFO* pOccDialogInfo);
|
||||
|
||||
#endif //!_AFX_NO_OCC_SUPPORT
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTDialogBar)
|
||||
#ifndef _AFX_NO_OCC_SUPPORT
|
||||
afx_msg LRESULT HandleInitDialog(WPARAM wParam, LPARAM lParam);
|
||||
#endif
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE BOOL CXTDialogBar::Create(CWnd* pParentWnd, UINT nIDTemplate, UINT nStyle, UINT nID) {
|
||||
return Create(pParentWnd, MAKEINTRESOURCE(nIDTemplate), nStyle, nID);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
#endif // #if !defined(__XTDIALOGBAR_H__)
|
||||
295
Editor/XT/Include/XTDockBar.h
Normal file
295
Editor/XT/Include/XTDockBar.h
Normal file
@@ -0,0 +1,295 @@
|
||||
// XTDockBar.h interface for the CXTDockBar class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTDOCKBAR_H__)
|
||||
#define __XTDOCKBAR_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
// class forwards.
|
||||
|
||||
class CXTDockWindow;
|
||||
|
||||
// Summary: CArray definition for CXTSplitterDock pointer array.
|
||||
typedef CArray <CXTSplitterDock *, CXTSplitterDock *> CXTSplitterDockArray;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTDockBar is a CDockBar derived class. It is used by CXTFrameWnd and
|
||||
// CXTMDIFrameWnd to offset CXTToolBars to allow 3D borders.
|
||||
class _XT_EXT_CLASS CXTDockBar : public CDockBar
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTDockBar)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTDockBar object.
|
||||
CXTDockBar();
|
||||
|
||||
// Summary: Destroys a CXTDockBar object, handles cleanup and de-allocation.
|
||||
virtual ~CXTDockBar();
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
int m_nTrackSplitter; // Splitter used to drag.
|
||||
BOOL m_bTracking; // TRUE when tracking.
|
||||
HWND m_hWndFocus; // Previous focus window when tracking.
|
||||
DWORD m_dwXTStyle; // FLAT styles.
|
||||
CXTSplitterDockArray m_arrSplitters; // Array of CXTSplitterDock objects.
|
||||
|
||||
public:
|
||||
|
||||
// Input: nBar - Index of the bar in the control bar array.
|
||||
// Returns: A pointer to a valid CXTDockWindow object.
|
||||
// Summary: This member function is called to determine if the docking window specified
|
||||
// by 'nBar' is maximized.
|
||||
CXTDockWindow* IsRowMaximized(int nBar);
|
||||
|
||||
// Input: pBar - A pointer to a valid CControlBar object.
|
||||
// lpRect - Initial size of the docked bar.
|
||||
// Summary: This member function is called to dock the control bar specified by 'pBar'.
|
||||
void DockControlBar(CControlBar* pBar,LPCRECT lpRect);
|
||||
|
||||
// Input: pMaxBar - A pointer to a valid CXTDockWindow object.
|
||||
// bRecalcLayout - TRUE if the parent frame needs to recalculate the layout.
|
||||
// Summary: This member function is called to maximize the control bar specified
|
||||
// by 'pMaxBar'.
|
||||
void Maximize(CXTDockWindow* pMaxBar,BOOL bRecalcLayout = TRUE);
|
||||
|
||||
// Input: pMaxBar - A pointer to a valid CXTDockWindow object.
|
||||
// bRecalcLayout - TRUE if the parent frame needs to recalculate the layout.
|
||||
// Summary: This member function is called to normalize the control bar specified
|
||||
// by 'pMaxBar'.
|
||||
void Normalize(CXTDockWindow* pMaxBar,BOOL bRecalcLayout = TRUE);
|
||||
|
||||
// Returns: The current CBRS_XT_ (Control bar) settings for the control bar. See
|
||||
// CXTDockWindow::ModifyXTBarStyle for the complete list of available
|
||||
// styles.
|
||||
// Summary: Call this member function to determine which CBRS_XT_ (control bar)
|
||||
// settings are currently set for the control bar. It does not handle
|
||||
// WS_ (window style) or CBRS_ (control bar style).
|
||||
// See Also: CXTDockWindow::ModifyXTBarStyle
|
||||
DWORD GetXTBarStyle();
|
||||
|
||||
// Input: dwNewStyle - New CBRS_XT_ style for the control bar. See CXTDockWindow::ModifyXTBarStyle
|
||||
// for the complete list of available styles.
|
||||
// Summary: This member function will set the style for the control bar. It does not
|
||||
// handle WS_ (window style) or CBRS_ (control bar style).
|
||||
void SetXTBarStyle(DWORD dwNewStyle);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTDockBar)
|
||||
public:
|
||||
virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
|
||||
virtual void HitTest(const CPoint& point);
|
||||
virtual void DoPaint(CDC* pDC);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual int InsertEx(CControlBar* pBarIns, CRect rect, CPoint ptMid);
|
||||
|
||||
#if _MSC_VER < 1200 // MFC 5.0
|
||||
virtual void DrawGripper(CDC* pDC, const CRect& rect);
|
||||
#endif //_MSC_VER < 1200
|
||||
|
||||
protected:
|
||||
|
||||
// Input: nInitPos - Initial position of the control bar whose row is to have its borders
|
||||
// removed.
|
||||
// dwBarStyle - Style for the row can be any CBRS_BORDER style. See
|
||||
// CControlBar::SetBarStyle for more details.
|
||||
// bOnlySized - TRUE if the control bar is to be only one sized.
|
||||
// Summary: This member function is called to remove the row borders for the row
|
||||
// of the control bar specified by 'nInitPos'.
|
||||
void RemoveRowBorders(int nInitPos,DWORD dwBarStyle = CBRS_BORDER_ANY,BOOL bOnlySized = FALSE);
|
||||
|
||||
// Input: nInitPos - Initial position of the bar in the control bar array.
|
||||
// nNewHeight - Size, in pixels, of the new row height.
|
||||
// Returns: The amount, in pixels, the row was adjusted.
|
||||
// Summary: This member function is called to set the height for the row of the
|
||||
// control bar specified by 'nInitPos'.
|
||||
int SetRowHeight(int nInitPos,int nNewHeight);
|
||||
|
||||
// Input: nInitPos - Initial position of the bar in the control bar array.
|
||||
// nIncWidth - Amount, in pixels, to increment the width by.
|
||||
// Returns: The amount, in pixels, the row was adjusted.
|
||||
// Summary: This member function is called to stretch the row of control bars to
|
||||
// the left.
|
||||
int StretchRowLeft(int nInitPos,int nIncWidth);
|
||||
|
||||
// Input: nInitPos - Initial position of the bar in the control bar array.
|
||||
// nIncWidth - Amount, in pixels, to increment the width by.
|
||||
// Returns: The amount, in pixels, the row was adjusted.
|
||||
// Summary: This member function is called to stretch the row of control bars to
|
||||
// the right.
|
||||
int StretchRowRight(int nInitPos,int nIncWidth);
|
||||
|
||||
// Input: nInitPos - Initial position of the bar in the control bar array.
|
||||
// pNewBar - A pointer to a valid CControlBar object.
|
||||
// Returns: The number of control bars docked on the row specified.
|
||||
// Summary: This member function gets the number of control bars docked on the
|
||||
// row that the control bar, specified by 'nInitPos', resides.
|
||||
int GetRowSizeBars(int nInitPos,CControlBar* pNewBar = NULL);
|
||||
|
||||
// Input: nInitPos - Initial position of the bar in the control bar array.
|
||||
// pNewBar - A pointer to a valid CControlBar object.
|
||||
// Returns: The width of the fixed bar including the splitters.
|
||||
// Summary: This member function gets the width of the fixed bar including the
|
||||
// splitter sizes.
|
||||
int GetRowFixedWidth(int nInitPos,CControlBar* pNewBar = NULL);
|
||||
|
||||
// Input: nInitPos - Initial position of the bar in the control bar array.
|
||||
// pNewBar - A pointer to a valid CControlBar object.
|
||||
// Returns: The minimum width of the row specified.
|
||||
// Summary: This member function gets the minimum width of the row for the control
|
||||
// bar specified by 'nInitPos'.
|
||||
int GetRowMinSizedWidth(int nInitPos,CControlBar* pNewBar = NULL);
|
||||
|
||||
// Input: nInitPos - Initial position of the bar in the control bar array.
|
||||
// pNewBar - A pointer to a valid CControlBar object.
|
||||
// Returns: The normal width of the row specified.
|
||||
// Summary: This member function gets the normal width of the row for the control
|
||||
// bar specified by 'nInitPos'.
|
||||
int GetRowSizedWidth(int nInitPos,CControlBar* pNewBar = NULL);
|
||||
|
||||
// Input: nInitPos - Initial position of the bar in the control bar array.
|
||||
// pNewBar - A pointer to a valid CControlBar object.
|
||||
// Returns: The minimum height of the row specified.
|
||||
// Summary: This member function gets the minimum height of the row for the
|
||||
// control bar specified by 'nInitPos'.
|
||||
int GetRowMaxHeight(int nInitPos,CControlBar* pNewBar = NULL);
|
||||
|
||||
// Input: nInitPos - Initial position of the bar in the control bar array.
|
||||
// pNewBar - A pointer to a valid CControlBar object.
|
||||
// Returns: The minimum height of the row specified.
|
||||
// Summary: This member function gets the minimum height of the row for the
|
||||
// control bar specified by 'nInitPos'.
|
||||
int GetRowMinHeight(int nInitPos,CControlBar* pNewBar = NULL);
|
||||
|
||||
// Returns: The dockbar's available height.
|
||||
// Summary: This member function gets the available height for the dockbar.
|
||||
int GetAvailableHeight();
|
||||
|
||||
// Input: pBar - A pointer to a valid CControlBar object.
|
||||
// Returns: An int value that represents first control bar in
|
||||
// the row.
|
||||
// Summary: This member function gets a pointer to the first control bar in
|
||||
// the row.
|
||||
int GetFirstBarInRow(CControlBar* pBar);
|
||||
|
||||
// Input: nInitPos - Initial position of the bar in the control bar array.
|
||||
// Summary: This member function is called to adjust the row sizes of the row for
|
||||
// the control bar specified by 'nInitPos'.
|
||||
void AdjustRowSizes(int nInitPos);
|
||||
|
||||
// Input: dc - A CDC pointer to a valid device context.
|
||||
// Summary: This member function is called to draw the splitter bars that separate
|
||||
// the docked control bars.
|
||||
void DrawSplitters(CDC* dc);
|
||||
|
||||
// Input: nStart - Starting position of the bar in the control bar array.
|
||||
// nType - Type of splitter bar; either XT_SPLITTER_VERT or XT_SPLITTER_HORZ.
|
||||
// nLength - Initial size of the splitter.
|
||||
// Summary: This member function is called to set the length of the splitters for
|
||||
// the docked control bars.
|
||||
void SetSplittersLength(int nStart,int nType,int nLength);
|
||||
|
||||
// Summary: This member function is called to free resources allocated for dock
|
||||
// splitters.
|
||||
void DeleteSplitters();
|
||||
|
||||
// Input: rcSplitter - A CRect object.
|
||||
// nType - Type of splitter bar; either XT_SPLITTER_VERT or XT_SPLITTER_HORZ.
|
||||
// bInterRow - TRUE if the splitter is an interior row.
|
||||
// nPos - Initial position of the splitter bar.
|
||||
// Summary: This member function is called to add a splitter to the dockbar.
|
||||
void AddSplitter(CRect rcSplitter,int nType,BOOL bInterRow,int nPos);
|
||||
|
||||
// Input: nInitPos - Initial position of the bar in the control bar array.
|
||||
// Returns: A pointer to a valid CControlBar object.
|
||||
// Summary: This member function is called to return a pointer to the bar specified
|
||||
// by 'nInitPos'.
|
||||
CControlBar *FindNewBar(int nInitPos);
|
||||
|
||||
// Input: nInitPos - Initial position of the bar in the control bar array.
|
||||
// Returns: A pointer to a valid CXTDockWindow object.
|
||||
// Summary: This member function is called to return a pointer to the control bar
|
||||
// specified by 'nInitPos'. 'nInitPos' is the index of the bar in the control
|
||||
// bar array.
|
||||
CXTDockWindow *FindUniqueBar(int nInitPos);
|
||||
|
||||
// Summary: This member function is called during sizing operations to cancel the
|
||||
// drag event.
|
||||
void OnCancel();
|
||||
|
||||
// Input: pBar - A pointer to a valid CControlBar object.
|
||||
// Returns: A pointer to a valid CXTDockWindow object, otherwise returns NULL.
|
||||
// Summary: This member function is called to get a valid handle for the control
|
||||
// bar specified by 'pBar'.
|
||||
CXTDockWindow* GetSafeDockWindow(CControlBar* pBar);
|
||||
|
||||
// Input: nPos - Initial position of the bar in the control bar array.
|
||||
// Returns: true if the bar is the last in the row, otherwise returns false.
|
||||
// Summary: This member function is called to determine if the control bar specified
|
||||
// by 'nPos' is the last control bar in the row.
|
||||
bool IsLastBarInRow(int nPos);
|
||||
|
||||
// Summary: This member function is called to determine the number of
|
||||
// visible docked control bars.
|
||||
int GetDockedVisibleCount() const;
|
||||
|
||||
// Input: pDC - A CDC pointer to a valid device context.
|
||||
// rect - A reference to a valid CRect object.
|
||||
// Summary: This member function is called during paint operations to draw the
|
||||
// non-client areas of the dockbar.
|
||||
void DrawNcBorders(CDC* pDC,CRect& rect);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTDockBar)
|
||||
afx_msg UINT OnNcHitTest(CPoint point);
|
||||
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
|
||||
afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnNcPaint();
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
friend class CXTDockWindow;
|
||||
friend class CXTSplitterWnd;
|
||||
friend class CXTSplitterDock;
|
||||
friend class CXTSplitterRowDock;
|
||||
friend class CXTMiniDockFrameWnd;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTDockBar::SetXTBarStyle(DWORD dwNewStyle) {
|
||||
m_dwXTStyle = dwNewStyle;
|
||||
}
|
||||
AFX_INLINE DWORD CXTDockBar::GetXTBarStyle() {
|
||||
ASSERT(::IsWindow(m_hWnd)); return m_dwXTStyle;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTDOCKBAR_H__)
|
||||
|
||||
77
Editor/XT/Include/XTDockColorSelector.h
Normal file
77
Editor/XT/Include/XTDockColorSelector.h
Normal file
@@ -0,0 +1,77 @@
|
||||
// XTDockColorSelector.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTDOCKCOLORSELECTOR_H__)
|
||||
#define __XTDOCKCOLORSELECTOR_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTDockColorSelector is a CXTDockWindow derived class. It is used to create
|
||||
// sizing / docking windows with color selector as a child.
|
||||
class _XT_EXT_CLASS CXTDockColorSelector : public CXTDockWindow
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTDockColorSelector)
|
||||
|
||||
public:
|
||||
// Summary: Constructs a CXTColorPopup object.
|
||||
CXTDockColorSelector();
|
||||
|
||||
// Summary: Destroys a CXTColorPopup object, handles cleanup and de-allocation.
|
||||
virtual ~CXTDockColorSelector();
|
||||
|
||||
// Input: pParentWnd - Pointer to the window that is the control bar<61>s parent.
|
||||
// nID - The control bar<61>s window ID.
|
||||
// lpszCaption - Points to a null-terminated character string that
|
||||
// represents the control bar name. Used as text for
|
||||
// the caption.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function creates a CXTDockColorSelector.
|
||||
BOOL Create(CWnd* pParentWnd,UINT nID,LPCTSTR lpszCaption=NULL);
|
||||
|
||||
// Summary: Call this member function to get Color Selector control.
|
||||
CXTColorSelectorCtrl* GetColorSelector();
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CDockWinEx1)
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
|
||||
afx_msg void OnButtonClose();
|
||||
afx_msg void OnUpdateButtonClose(CCmdUI* pCmdUI);
|
||||
afx_msg LRESULT OnSelEndOK(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnQueryVisualize(WPARAM, LPARAM);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
private:
|
||||
|
||||
CXTColorSelectorCtrl m_wndColors;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE CXTColorSelectorCtrl* CXTDockColorSelector::GetColorSelector() {
|
||||
return &m_wndColors;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif //__XTDOCKCOLORSELECTOR_H__
|
||||
145
Editor/XT/Include/XTDockContext.h
Normal file
145
Editor/XT/Include/XTDockContext.h
Normal file
@@ -0,0 +1,145 @@
|
||||
// XTDockContext.h interface for the CXTDockContext class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTDOCKCONTEXT_H__)
|
||||
#define __XTDOCKCONTEXT_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
// class forwards
|
||||
|
||||
class CXTDockBar;
|
||||
class CXTDockWindow;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTDockContext is a CDockContext derived class. It is used by CXTDockWindow
|
||||
// and CXTMiniDockFrameWnd for docking and sizing control bars.
|
||||
class _XT_EXT_CLASS CXTDockContext : public CDockContext
|
||||
{
|
||||
public:
|
||||
// Listeners for drag state changes.
|
||||
|
||||
typedef CXTCallbacks<CXTDockContext*, 4> LISTENERS;
|
||||
typedef LISTENERS::NOTIFYCB LISTENERCB;
|
||||
|
||||
public:
|
||||
|
||||
// Input: pBar - Pointer to a CControlBar object.
|
||||
// Summary: Constructs a CXTDockContext object.
|
||||
CXTDockContext(CControlBar* pBar);
|
||||
|
||||
// Summary: Destroys a CXTDockContext object, handles cleanup and de-allocation.
|
||||
virtual ~CXTDockContext();
|
||||
|
||||
protected:
|
||||
|
||||
bool m_bFullWindowDrag; // Tells if full window drag is shall be executed.
|
||||
bool m_bRecalcPending;
|
||||
bool m_bTracking; // Tells if the context currently tracking mouse during drag/resize operation
|
||||
CPoint m_ptOrig; // Cursor position.
|
||||
LISTENERS m_trackStateListeners; // Listeners for tracking state change notifications
|
||||
CTypedPtrArray<CObArray, CFrameWnd*> m_arrFramesPendingRecalc;
|
||||
|
||||
public:
|
||||
|
||||
// Returns: true if it is tracking a mouse, otherwise it returns false.
|
||||
// Summary: This member function tells if this object is currently tracking a mouse
|
||||
// during a drag or resize operation.
|
||||
bool IsTracking() const;
|
||||
|
||||
// Summary: This member function is called by CXTDockContext when a drag operation
|
||||
// completes.
|
||||
void EndDrag();
|
||||
|
||||
// Input: pt - CPoint object that represents the current cursor location.
|
||||
// Summary: This member function is called by CXTDockWindow and CXTMiniDockFrameWnd
|
||||
// whenever a drag operation begins.
|
||||
virtual void StartDrag(CPoint pt);
|
||||
|
||||
// Returns: A DWORD value.
|
||||
// Summary: This member function is called by CXTDockContext to determine whether
|
||||
// a control bar is dockable.
|
||||
DWORD CanDock();
|
||||
|
||||
// Input: rect - Size of the control bar.
|
||||
// dwDockStyle - Control bar style.
|
||||
// ppDockBar - Points to a CDockBar pointer.
|
||||
// Returns: A DWORD value.
|
||||
// Summary: This member function is called by CXTDockContext to determine whether
|
||||
// a control bar is dockable.
|
||||
DWORD CanDock(CRect rect,DWORD dwDockStyle,CDockBar** ppDockBar = NULL);
|
||||
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function is called by CXTDockContext whenever a drag
|
||||
// operation begins.
|
||||
BOOL Track();
|
||||
|
||||
// Input: dwOverDockStyle - Control bar style.
|
||||
// Returns: A CXTDockBar pointer.
|
||||
// Summary: This member function is called by CXTDockContext to get a pointer
|
||||
// to a CXTDockBar object.
|
||||
CXTDockBar* GetDockBar(DWORD dwOverDockStyle);
|
||||
|
||||
// Summary: This member function is used to toggle the docked state of a control
|
||||
// bar.
|
||||
virtual void ToggleDocking();
|
||||
|
||||
// Input: pt - CPoint object that represents the current cursor location.
|
||||
// Summary: This member function is called to enable diagonal sizing for
|
||||
// the control bar.
|
||||
void Stretch(CPoint pt);
|
||||
|
||||
// Input: listener - A pointer to a CObject object.
|
||||
// cb - LISTENERCB object.
|
||||
// Summary: This member function adds a listener for drag state change notifications.
|
||||
void AddTrackStateListener(CObject* listener, LISTENERCB cb);
|
||||
|
||||
// Input: listener - A pointer to a CObject object.
|
||||
// Summary: This member function removes a listener.
|
||||
void RemoveListener(CObject* listener);
|
||||
|
||||
void DeferRecalcLayout(CFrameWnd* pFrame);
|
||||
virtual void StartResize(int nHitTest, CPoint pt);
|
||||
void Move(CPoint pt);
|
||||
void DrawFocusRect(BOOL bRemoveRect = FALSE);
|
||||
void OnKey(int nChar, BOOL bDown);
|
||||
void UpdateState(BOOL* pFlag, BOOL bNewValue);
|
||||
bool CanDock(CFrameWnd* pFrame, DWORD& dwResult, CRect rect, DWORD dwDockStyle, CDockBar** ppDockBar);
|
||||
void FlushRecalcLayout(CFrameWnd* pFrame);
|
||||
virtual CFrameWnd* GetAlternateSite();
|
||||
|
||||
private:
|
||||
void InitLoop();
|
||||
void CancelLoop();
|
||||
void EndResize();
|
||||
|
||||
void AdjustRectangle(CRect& rect, CPoint pt);
|
||||
void FloatControlBar(DWORD dwFloatStyle);
|
||||
friend class CXTControlBar;
|
||||
friend class CXTTrackDockContextCleanup;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE bool CXTDockContext::IsTracking() const {
|
||||
return m_bTracking;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTDOCKCONTEXT_H__)
|
||||
109
Editor/XT/Include/XTDockState.h
Normal file
109
Editor/XT/Include/XTDockState.h
Normal file
@@ -0,0 +1,109 @@
|
||||
// XTDockState.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __XTDOCKSTATE_H__
|
||||
#define __XTDOCKSTATE_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTControlBarInfo is a CControlBarInfo derived class. It is used to
|
||||
// load and save the information about control bars.
|
||||
class CXTControlBarInfo : public CControlBarInfo
|
||||
{
|
||||
public:
|
||||
|
||||
// Input: lpszProfileName - Points to a null-terminated string that specifies the name of a section
|
||||
// in the initialization file or a key in the Windows registry where
|
||||
// state information is stored.
|
||||
// nIndex - Index of the control bar in the array.
|
||||
// pDockState - A pointer to a valid CDockState object.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this function to retrieve state information from the registry
|
||||
// or .INI file. The profile name is the section of the application's
|
||||
// .INI file or the registry that contains the bars' state information.
|
||||
// You can save control bar state information to the registry or .INI
|
||||
// file with SaveState.
|
||||
BOOL LoadState(LPCTSTR lpszProfileName,int nIndex,CDockState* pDockState);
|
||||
|
||||
// Input: lpszProfileName - Points to a null-terminated string that specifies the name of a section
|
||||
// in the initialization file or a key in the Windows registry where
|
||||
// state information is stored.
|
||||
// nIndex - Index of the control bar in the array.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this function to save the state information to the registry or
|
||||
// .INI file. The profile name is the section of the application's .INI
|
||||
// file or the registry that contains the control bar's state information.
|
||||
// SaveState also saves the current screen size. You can retrieve control
|
||||
// bar information from the registry or .INI file with LoadState.
|
||||
BOOL SaveState(LPCTSTR lpszProfileName,int nIndex);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTDockState is a serialized CObject derived class. It loads, unloads,
|
||||
// or clears the state of one or more docking control bars in persistent
|
||||
// memory (a file). The dock state includes the size and position of the
|
||||
// bar and whether or not it is docked. When retrieving the stored dock
|
||||
// state, CXTDockState checks the bar's position and, if the bar is not
|
||||
// visible with the current screen settings, CXTDockState scales the bar's
|
||||
// position so that it is visible. The main purpose of CXTDockState is
|
||||
// to hold the entire state of a number of control bars and to allow that
|
||||
// state to be saved and loaded either to the registry, the application's
|
||||
// .INI file, or in binary form as part of a CArchive object's contents.
|
||||
//
|
||||
// The bar can be any dockable control bar, including a toolbar, status
|
||||
// bar, or dialog bar. CXTDockState objects are written and read to, or
|
||||
// from, a file via a CArchive object.
|
||||
//
|
||||
// CXTFrameWnd::GetDockState retrieves the state information of all the
|
||||
// frame window's CXTControlBar objects and puts it into the CXTDockState
|
||||
// object. You can then write the contents of the CXTDockState object
|
||||
// to storage with Serialize or CXTDockState::SaveState. If you later want
|
||||
// to restore the state of the control bars in the frame window, you can
|
||||
// load the state with Serialize or CXTDockState::LoadState, then use
|
||||
// CXTFrameWnd::SetDockState to apply the saved state to the frame window's
|
||||
// control bars.
|
||||
class CXTDockState : public CDockState
|
||||
{
|
||||
DECLARE_SERIAL(CXTDockState)
|
||||
public:
|
||||
|
||||
// Input: lpszProfileName - Points to a null-terminated string that specifies the name of a section
|
||||
// in the initialization file or a key in the Windows registry where
|
||||
// state information is stored.
|
||||
// Summary: Call this function to retrieve state information from the registry
|
||||
// or .INI file. The profile name is the section of the application's
|
||||
// .INI file or the registry that contains the bar's state information.
|
||||
// You can save control bar state information to the registry or .INI
|
||||
// file with SaveState.
|
||||
void LoadState(LPCTSTR lpszProfileName);
|
||||
|
||||
// Input: lpszProfileName - Points to a null-terminated string that specifies the name of a section
|
||||
// in the initialization file or a key in the Windows registry where
|
||||
// state information is stored.
|
||||
// Summary: Call this function to save the state information to the registry or
|
||||
// .INI file. The profile name is the section of the application's .INI
|
||||
// file or the registry that contains the control bar's state information.
|
||||
// SaveState also saves the current screen size. You can retrieve control
|
||||
// bar information from the registry or .INI file with LoadState.
|
||||
void SaveState(LPCTSTR lpszProfileName);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // __XTDOCKSTATE_H__
|
||||
459
Editor/XT/Include/XTDockWindow.h
Normal file
459
Editor/XT/Include/XTDockWindow.h
Normal file
@@ -0,0 +1,459 @@
|
||||
// XTDockWindow.h interface for the CXTDockWindow class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTDOCKWINDOW_H__)
|
||||
#define __XTDOCKWINDOW_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
// forwards
|
||||
|
||||
class CXTBarButton;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTDockWindow is a CXTControlBar derived class. It is used to create
|
||||
// sizing / docking windows similar to those seen in Developer Studio.
|
||||
class _XT_EXT_CLASS CXTDockWindow : public CXTControlBar
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTDockWindow)
|
||||
|
||||
friend class CXTBarButton;
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTDockWindow object.
|
||||
CXTDockWindow();
|
||||
|
||||
// Summary: Destroys a CXTDockWindow object, handles cleanup and de-allocation.
|
||||
virtual ~CXTDockWindow();
|
||||
|
||||
protected:
|
||||
|
||||
int m_cxOffset; // Used to offset the horizontal client area to allow room for the caption when docked.
|
||||
int m_nBtnIndex; // Used to determine which button icon to display when the control bar is minimized or maximized depending on which side docked.
|
||||
CWnd* m_pChildWnd; // CWnd pointer which contains the child window that is displayed in the control bar. See SetChild(CWnd* pWnd).
|
||||
BOOL m_bActive; // TRUE if the docking window is currently active.
|
||||
BOOL m_bMenuRemoved; // TRUE when the system menu is removed from a floating docking window.
|
||||
CFrameWnd* m_pParentFrame; // Points to the parent frame.
|
||||
CToolTipCtrl m_ToolTip; // Tooltip used for caption buttons.
|
||||
CXTBarButton* m_pBtnClose; // Close button used in caption area.
|
||||
CXTBarButton* m_pBtnMinim; // Minimize button used in the caption area.
|
||||
CXTIconHandle m_hIconHide; // Hide button icon.
|
||||
CXTIconHandle m_hIconMaxHDisable; // Horizontal max button icon disabled.
|
||||
CXTIconHandle m_hIconMaxHEnable; // Horizontal max button icon enabled.
|
||||
CXTIconHandle m_hIconMaxVDisable; // Vert max button icon disabled.
|
||||
CXTIconHandle m_hIconMaxVEnable; // Vert max button icon enabled.
|
||||
CXTIconHandle m_hIconHDisable; // Horizontal button icon disabled.
|
||||
CXTIconHandle m_hIconHEnabled; // Horizontal button icon enabled.
|
||||
CXTIconHandle m_hIconVDisable; // Vert button icon disabled.
|
||||
CXTIconHandle m_hIconVEnabled; // Vert button icon enabled.
|
||||
|
||||
private:
|
||||
|
||||
DWORD m_dwInitSignature; // Used to validate pending initialization requests
|
||||
|
||||
public:
|
||||
|
||||
//BULLETED LIST:
|
||||
|
||||
// Input: dwAdd - Specifies CBRS_XT_ styles to be removed during style
|
||||
// modification.
|
||||
// dwAdd - Specifies CBRS_XT_ styles to be added during style
|
||||
// modification.
|
||||
// bRedraw - TRUE to redraw the control bar.
|
||||
// Returns: Nonzero if style was successfully modified, otherwise returns zero.
|
||||
// Summary: Call this member function to modify a control bar style. Styles to
|
||||
// be added or removed can be combined by using the bitwise OR (|)
|
||||
// operator.
|
||||
//
|
||||
// The desired styles for the control bar can be one or more of
|
||||
// the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_XT_BUTTONS</b> The control bar has a minimize and close
|
||||
// button when docked.[/li]
|
||||
// [li]<b>CBRS_XT_GRIPPER</b> The control bar has a gripper when docked.[/li]
|
||||
// [li]<b>CBRS_XT_GRIPPER_FLAT</b> The control bar has a flat gripper.
|
||||
// Use with CBRS_XT_GRIPPER.[/li]
|
||||
// [li]<b>CBRS_XT_GRIPPER_GRAD</b> The control bar has a gradient
|
||||
// flat gripper. Use with CBRS_XT_GRIPPER_FLAT.[/li]
|
||||
// [li]<b>CBRS_XT_GRIPPER_TEXT</b> The control bar draws text in the
|
||||
// gripper area. Use with CBRS_XT_GRIPPER.[/li]
|
||||
// [li]<b>CBRS_XT_BUTTONS_FLAT</b> The control bar min and max buttons
|
||||
// are flat. Use with CBRS_XT_BUTTONS.[/li]
|
||||
// [li]<b>CBRS_XT_BORDERS_FLAT</b> The control bar borders are flat.[/li]
|
||||
// [li]<b>CBRS_XT_CLIENT_OUTLINE</b> Draw a single black border outline
|
||||
// around the client area.[/li]
|
||||
// [li]<b>CBRS_XT_CLIENT_STATIC</b> Draw a static rect around the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_XT_CLIENT_MODAL</b> Draw a modal rect around the client
|
||||
// area.[/li]
|
||||
// [li]<b>CBRS_XT_ALL_FLAT</b> The following styles combined by using
|
||||
// the bitwise OR (|) operator CBRS_XT_GRIPPER_FLAT, CBRS_XT_BUTTONS_FLAT,
|
||||
// and CBRS_XT_BORDERS_FLAT.[/li]
|
||||
// [li]<b>CBRS_XT_DEFAULT</b> The following styles combined by using
|
||||
// the bitwise OR (|) operator CBRS_XT_BUTTONS, CBRS_XT_GRIPPER,
|
||||
// and CBRS_XT_GRIPPER_TEXT.[/li]
|
||||
// [/ul]
|
||||
virtual BOOL ModifyXTBarStyle(DWORD dwRemove,DWORD dwAdd,BOOL bRedraw=TRUE);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: pParentWnd - Pointer to the window that is the control bar<61>s parent.
|
||||
// nID - The control bar<61>s window ID.
|
||||
// lpszCaption - Points to a null-terminated character string that
|
||||
// represents the control bar name. Used as text for
|
||||
// the caption.
|
||||
// size - Specifies the default size of the control bar.
|
||||
// dwStyle - The control bar style. Additional toolbar styles
|
||||
// supported are:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_TOP</b> Control bar is at the top of the frame window.[/li]
|
||||
// [li]<b>CBRS_BOTTOM</b> Control bar is at the bottom of the frame
|
||||
// window.[/li]
|
||||
// [li]<b>CBRS_NOALIGN</b> Control bar is not repositioned when
|
||||
// the parent is resized.[/li]
|
||||
// [li]<b>CBRS_TOOLTIPS</b> Control bar displays tool tips.[/li]
|
||||
// [li]<b>CBRS_SIZE_DYNAMIC</b> Control bar is dynamic.[/li]
|
||||
// [li]<b>CBRS_SIZE_FIXED</b> Control bar is fixed.[/li]
|
||||
// [li]<b>CBRS_FLOATING</b> Control bar is floating.[/li]
|
||||
// [li]<b>CBRS_FLYBY</b> Status bar displays information about
|
||||
// the button.[/li]
|
||||
// [li]<b>CBRS_HIDE_INPLACE</b> Control bar is not displayed to
|
||||
// the user.[/li]
|
||||
// [/ul]
|
||||
// dwBarStyle - Specifies CBRS_XT_ styles to be used during creation.
|
||||
// See ModifyXTBarStyle for information about the available
|
||||
// control bar styles.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function creates a CXTDockWindow (a docking window).
|
||||
// It also sets the control bar default size, style, ID, and caption text.
|
||||
virtual BOOL Create(CWnd* pParentWnd,UINT nID,LPCTSTR lpszCaption=NULL, CSize size=CSize(200,100),DWORD dwStyle=CBRS_LEFT,DWORD dwBarStyle=CBRS_XT_DEFAULT);
|
||||
|
||||
// Input: rect - Reference to a CRect object which contains the size of
|
||||
// the child window associated with the control bar.
|
||||
// Summary: This member function is called by the control bar, and can be overloaded
|
||||
// in derived classes to return the rect for the child window associated
|
||||
// with the control bar.
|
||||
virtual void GetInsideRect(CRect &rect);
|
||||
|
||||
// Returns: The minimum extent for a minimized control bar.
|
||||
// Summary: This member function is called to determine the minimum extent of
|
||||
// the control bar when minimized or maximized.
|
||||
virtual int GetMinExt();
|
||||
|
||||
// Returns: Nonzero if the docked control bar is maximized, otherwise returns zero.
|
||||
// Summary: This member function is used to determine if the docked control
|
||||
// bar is maximized.
|
||||
virtual BOOL IsMaximized() const;
|
||||
|
||||
// Returns: Nonzero if the docked control bar is unique, otherwise returns zero.
|
||||
// Summary: This member function is used to determine if the docked control
|
||||
// bar is unique.
|
||||
virtual BOOL IsUnique() const;
|
||||
|
||||
// Input: size - A reference to a CSize object that contains the normal
|
||||
// size that the control bar should be.
|
||||
// Summary: This member function is called to set the normal size the for
|
||||
// the control bar.
|
||||
virtual void SetNormalSize(const CSize &size);
|
||||
|
||||
// Summary: This member function is called to initialize the default size
|
||||
// to the current float size.
|
||||
virtual void SetFloatSize();
|
||||
|
||||
// Summary: This member function is called to return the control bar to
|
||||
// its normal size.
|
||||
virtual void Normalize();
|
||||
|
||||
// Returns: The docking window's minimized size in pixels.
|
||||
// Summary: This member function is called to minimize the control bar.
|
||||
virtual int Minimize();
|
||||
|
||||
// Input: size - Indicates the width or height of the bar.
|
||||
// Summary: This member function is called to maximize the control bar.
|
||||
virtual void Maximize(int size);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwDockStyle - Specifies whether the control bar supports docking
|
||||
// and the sides of its parent window to which the
|
||||
// control bar can be docked, if supported. It can be one
|
||||
// or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_ALIGN_TOP</b> Allows docking at the top of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_BOTTOM</b> Allows docking at the bottom of
|
||||
// the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_LEFT</b> Allows docking on the left side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_RIGHT</b> Allows docking on the right side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_ANY</b> Allows docking on any side of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_FLOAT_MULTI</b> Allows multiple control bars to
|
||||
// be floated in a single mini-frame window. If 0 (that is, indicating
|
||||
// no flags), the control bar will not dock.[/li]
|
||||
// [/ul]
|
||||
// Summary: Call this function to enable a control bar to be docked. The sides
|
||||
// specified must match one of the sides enabled for docking in the
|
||||
// destination frame window, or the control bar cannot be docked to
|
||||
// that frame window.
|
||||
virtual void EnableDocking(DWORD dwDockStyle);
|
||||
|
||||
// Returns: An int value that represents the current width of the vertically docked
|
||||
// control bar.
|
||||
// Summary: This member function is used to determine the width of the control
|
||||
// bar when docked vertically.
|
||||
virtual int GetVertSize();
|
||||
|
||||
// Returns: An int value that represents the current height of the horizontally docked
|
||||
// control bar.
|
||||
// Summary: This member function is used to determine the width of the control
|
||||
// bar when docked horizontally.
|
||||
virtual int GetHorzSize();
|
||||
|
||||
// Input: strSection - Name of a section in the initialization file or a key
|
||||
// in the Windows registry where state information is stored.
|
||||
// Summary: Call this member function to restore the settings of each control
|
||||
// bar owned by the frame window. This information is written to the
|
||||
// initialization file using SaveBarSize. Information restored includes
|
||||
// visibility, horizontal/vertical orientation, docking state, and control bar
|
||||
// position. This function call is handled by CXTFrameWnd::LoadBarState,
|
||||
// and should <b>not</b> be called directly.
|
||||
void LoadBarSize(CString strSection);
|
||||
|
||||
// Input: strSection - Name of a section in the initialization file or a key
|
||||
// in the Windows registry where state information is stored.
|
||||
// Summary: Call this function to store information about each control bar owned
|
||||
// by the frame window. This information can be read from the initialization
|
||||
// file using LoadBarSize. Information stored includes visibility,
|
||||
// horizontal/vertical orientation, docking state, and control bar
|
||||
// position. This function call is handled by CXTFrameWnd::SaveBarState,
|
||||
// and should <b>not</b> be called directly.
|
||||
void SaveBarSize(CString strSection);
|
||||
|
||||
// Input: pViewClass - CView runtime class associated with the tab.
|
||||
// pDocument - CDocument associated with the view.
|
||||
// pContext - Create context for the view.
|
||||
// Returns: A CWnd pointer to the newly created view if successful, otherwise returns NULL.
|
||||
// Summary: Call this member function to create a view. You can then call SetChild
|
||||
// to add the view to this docking window.
|
||||
virtual CWnd* CreateView(CRuntimeClass *pViewClass,CDocument *pDocument,CCreateContext *pContext);
|
||||
|
||||
// Input: pFrameClass - CFrameWnd runtime class.
|
||||
// pViewClass - CView runtime class.
|
||||
// pDocument - CDocument runtime class, can be NULL.
|
||||
// bNoBorder - Set to true to display 3D border for the frame, by default the
|
||||
// views border is used.
|
||||
// Returns: A pointer to a CFrameWnd object.
|
||||
// Summary: This member function is called to create a CFrameWnd object that is used
|
||||
// to display a view inside of a docking window. Using views with controls bars is a
|
||||
// complex issue. The problem results from the MFC <20>frame-doc-view<65> architecture
|
||||
// which makes the implementation difficult due to the close relationship that a
|
||||
// view has with a frame window. Because of this relationship, messages are
|
||||
// sometimes not routed correctly and view activation can have undesired results when
|
||||
// used inside of a control bar.
|
||||
//
|
||||
// In order to use a CView object with a docking window, or any control bar object
|
||||
// you will need to create a pseudo CFrameWnd object to act as the parent frame for
|
||||
// the CView. You can then use this frame as the child of the docking window to
|
||||
// display your view. This trick will allow messages to correctly route
|
||||
// throughout your applications framework, and view activation will not interfere
|
||||
// with your applications primary <20>frame-doc-view<65> architecture.
|
||||
CFrameWnd* CreateFrameDocView(CRuntimeClass* pFrameClass,CRuntimeClass* pViewClass,CDocument* pDocument=NULL,bool bNoBorder=true);
|
||||
|
||||
// Input: pWnd - Points to the child CWnd object that is associated with the control
|
||||
// bar. This pointer is used to resize the child window accordingly.
|
||||
// Summary: This member function is used to associate a child window that is to be
|
||||
// displayed in the control bar.
|
||||
virtual void SetChild(CWnd* pWnd);
|
||||
|
||||
// Input: pBP - Points to an XT_BARPLACEMENT struct which is used to
|
||||
// initialize the placement for the control bar.
|
||||
// Summary: This member function is called to initialize the XT_BARPLACEMENT struct
|
||||
// which contains size, location, and style information for the control bar.
|
||||
virtual void SetBarPlacement(XT_BARPLACEMENT* pBP);
|
||||
|
||||
// Returns: A CRect value that represents the size and location of the first grip line
|
||||
// in the caption area when docked.
|
||||
// Summary: This member function is called to calculate the size of the gripper
|
||||
// displayed in the caption area of a docked control bar.
|
||||
virtual CRect GetGripperRect();
|
||||
|
||||
// Returns: A CRect value that represents the size and location of the close frame
|
||||
// button when docked.
|
||||
// Summary: This member function is called to calculate the size of the frame
|
||||
// buttons used in the caption area of a docked control bar.
|
||||
virtual CRect GetButtonRect();
|
||||
|
||||
// Input: pObject - Represents a valid CObject pointer.
|
||||
// Returns: TRUE if the object is a CXTDockWindow object, otherwise returns FALSE.
|
||||
// Summary: This member function checks to see if the object passed in as 'pObject'
|
||||
// is a CXTDockWindow object.
|
||||
static BOOL IsDockWindow(CObject* pObject);
|
||||
|
||||
// Input: lpszCaption - Points to a CString object or null-terminated string to
|
||||
// be used as the new title or control text.
|
||||
// Summary: This member function overrides CWnd::SetWindowText(...), and sets
|
||||
// the control bar<61>s title to the specified text.
|
||||
virtual void SetCaption(LPCTSTR lpszCaption);
|
||||
|
||||
protected:
|
||||
|
||||
// Input: pDC - Points to a device context. The function draws the gripper into
|
||||
// this device context.
|
||||
// Summary: This member function is called by the control bar to draw the gripper
|
||||
// in the caption area of a docked control bar.
|
||||
virtual void OnDrawGripper(CDC* pDC);
|
||||
|
||||
// Input: pDC - Points to a device context. The function draws the borders into
|
||||
// this device context.
|
||||
// rect - A reference to a CRect object that represents the size of the
|
||||
// border to be drawn.
|
||||
// Summary: This member function is called by the control bar to draw its borders.
|
||||
virtual void DrawBorders(CDC* pDC,CRect &rect);
|
||||
|
||||
// Summary: This member function is called by the control bar to perform
|
||||
// paint operations.
|
||||
virtual void EraseNonClient();
|
||||
|
||||
// Input: pDC - Pointer to the current device context.
|
||||
// rect - Size of the area to paint.
|
||||
// Summary: This member function is called by the docking window to draw the
|
||||
// caption area for the docked bars.
|
||||
virtual void DrawCaption(CDC* pDC,const CRect& rect);
|
||||
|
||||
// Input: bActive - Set to TRUE to cause the caption bar to appear active.
|
||||
// Summary: This member function is called by the docking window to set the
|
||||
// caption bar to an "active" or "inactive" state.
|
||||
virtual void SetActiveState(BOOL bActive);
|
||||
|
||||
// Summary: This member function is called to refresh the caption button display
|
||||
// for the docking window.
|
||||
virtual void UpdateButtonXStyles();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTDockWindow)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
|
||||
virtual CSize CalcDynamicLayout(int nLength, DWORD nMode);
|
||||
virtual void DoPaint(CDC* pDC);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual void DelayShow(BOOL bShow);
|
||||
virtual void HideShowButtons(int nCmdShow);
|
||||
virtual void SetDockWindowStyle(DWORD dwStyle);
|
||||
|
||||
// Generated message map functions
|
||||
|
||||
protected:
|
||||
|
||||
bool HasGripper();
|
||||
bool HasButtons();
|
||||
bool HasFlatButtons();
|
||||
bool HasCaption();
|
||||
bool HasGradientCaption();
|
||||
bool HasText();
|
||||
bool HasTwoGrips();
|
||||
bool HasSemiFlatBorder();
|
||||
bool HasClientBorderOutline();
|
||||
bool HasClientBorderStatic();
|
||||
bool HasClientBorderModal();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTDockWindow)
|
||||
afx_msg UINT OnNcHitTest(CPoint point);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
|
||||
afx_msg void OnButtonClose();
|
||||
afx_msg void OnUpdateButtonClose(CCmdUI* pCmdUI);
|
||||
afx_msg void OnButtonMinimize();
|
||||
afx_msg void OnUpdateButtonMinimize(CCmdUI* pCmdUI);
|
||||
afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnXTInitialUpdate(WPARAM, LPARAM);
|
||||
afx_msg void OnInitialUpdate();
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
friend class CXTDockBar;
|
||||
friend class CXTFrameWnd;
|
||||
friend class CXTSplitterDock;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE int CXTDockWindow::GetVertSize() {
|
||||
ASSERT(::IsWindow(m_hWnd)); return m_bp.sizeDefault.cx;
|
||||
}
|
||||
AFX_INLINE int CXTDockWindow::GetHorzSize() {
|
||||
ASSERT(::IsWindow(m_hWnd)); return m_bp.sizeDefault.cy;
|
||||
}
|
||||
AFX_INLINE BOOL CXTDockWindow::IsMaximized() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (m_bp.bMaximized);
|
||||
}
|
||||
AFX_INLINE BOOL CXTDockWindow::IsUnique() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (m_bp.bUnique);
|
||||
}
|
||||
AFX_INLINE void CXTDockWindow::SetFloatSize() {
|
||||
ASSERT(::IsWindow(m_hWnd)); m_bp.sizeDefault = m_bp.sizeFloat;
|
||||
}
|
||||
AFX_INLINE bool CXTDockWindow::HasGripper() {
|
||||
return ((m_bp.dwStyle & CBRS_XT_GRIPPER) == CBRS_XT_GRIPPER);
|
||||
}
|
||||
AFX_INLINE bool CXTDockWindow::HasButtons() {
|
||||
return (HasGripper() && ((m_bp.dwStyle & CBRS_XT_BUTTONS) == CBRS_XT_BUTTONS));
|
||||
}
|
||||
AFX_INLINE bool CXTDockWindow::HasFlatButtons() {
|
||||
return (HasButtons() && (((m_bp.dwStyle & CBRS_XT_BUTTONS_FLAT) == CBRS_XT_BUTTONS_FLAT) || xtAfxData.bXPMode));
|
||||
}
|
||||
AFX_INLINE bool CXTDockWindow::HasCaption() {
|
||||
return (HasGripper() && xtAfxData.bXPMode || ((m_bp.dwStyle & CBRS_XT_GRIPPER_FLAT) == CBRS_XT_GRIPPER_FLAT));
|
||||
}
|
||||
AFX_INLINE bool CXTDockWindow::HasGradientCaption() {
|
||||
return (HasCaption() && ((m_bp.dwStyle & CBRS_XT_GRIPPER_GRAD) == CBRS_XT_GRIPPER_GRAD));
|
||||
}
|
||||
AFX_INLINE bool CXTDockWindow::HasText() {
|
||||
return (HasGripper() && ((m_bp.dwStyle & CBRS_XT_GRIPPER_TEXT) == CBRS_XT_GRIPPER_TEXT));
|
||||
}
|
||||
AFX_INLINE bool CXTDockWindow::HasTwoGrips() {
|
||||
return (HasGripper() && ((m_bp.dwStyle & CBRS_XT_TWOGRIP) == CBRS_XT_TWOGRIP));
|
||||
}
|
||||
AFX_INLINE bool CXTDockWindow::HasSemiFlatBorder() {
|
||||
return ((m_bp.dwStyle & CBRS_XT_SEMIFLAT) == CBRS_XT_SEMIFLAT && !xtAfxData.bXPMode);
|
||||
}
|
||||
AFX_INLINE bool CXTDockWindow::HasClientBorderOutline() {
|
||||
return ((m_bp.dwStyle & CBRS_XT_CLIENT_OUTLINE) == CBRS_XT_CLIENT_OUTLINE);
|
||||
}
|
||||
AFX_INLINE bool CXTDockWindow::HasClientBorderStatic() {
|
||||
return ((m_bp.dwStyle & CBRS_XT_CLIENT_STATIC) == CBRS_XT_CLIENT_STATIC);
|
||||
}
|
||||
AFX_INLINE bool CXTDockWindow::HasClientBorderModal() {
|
||||
return ((m_bp.dwStyle & CBRS_XT_CLIENT_MODAL) == CBRS_XT_CLIENT_MODAL);
|
||||
}
|
||||
AFX_INLINE BOOL CXTDockWindow::IsDockWindow(CObject* pObject) {
|
||||
return pObject->IsKindOf(RUNTIME_CLASS(CXTDockWindow));
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTDOCKWINDOW_H__)
|
||||
147
Editor/XT/Include/XTDropSource.h
Normal file
147
Editor/XT/Include/XTDropSource.h
Normal file
@@ -0,0 +1,147 @@
|
||||
// XTDropSource.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __XTDROPSOURCE_H__
|
||||
#define __XTDROPSOURCE_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
// NUMBERED LIST:
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTDropSource class is derived from IDropSource. It is used by the
|
||||
// shell list control to provide drag-and-drop operations in your application.
|
||||
//
|
||||
// It contains methods used in any application used as a data source in
|
||||
// a drag-and-drop operation. The data source application in a drag-and-drop
|
||||
// operation is responsible for:
|
||||
// [ol]
|
||||
// [li]Determining the data being dragged based on the user's selection.[/li]
|
||||
// [li]Initiating the drag-and-drop operation based on the user's mouse actions. [/li]
|
||||
// [li]Generating some of the visual feedback during the drag-and-drop operation, such
|
||||
// as setting the cursor and highlighting the data selected for the
|
||||
// drag-and-drop operation.[/li]
|
||||
// [li]Canceling or completing the drag-and-drop operation based on the
|
||||
// user's mouse actions.[/li]
|
||||
// [li]Performing any action on the original data caused by the drop operation,
|
||||
// such as deleting the data on a drag move.[/li]
|
||||
// [/ol]
|
||||
// CXTDropSource contains the methods for generating visual feedback to
|
||||
// the end user and for canceling or completing the drag-and-drop operation.
|
||||
// You also need to call the DoDragDrop, RegisterDragDrop, and RevokeDragDrop
|
||||
// functions in drag-and-drop operations.
|
||||
class _XT_EXT_CLASS CXTDropSource : public IDropSource
|
||||
{
|
||||
protected:
|
||||
|
||||
UINT m_uiRefCount; // Indicates the current reference count.
|
||||
|
||||
public:
|
||||
// Summary: Constructs a CXTDropSource object.
|
||||
CXTDropSource();
|
||||
|
||||
// Summary: Destroys a CXTDropSource object, handles clean up and de-allocation.
|
||||
~CXTDropSource();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// IUnknown Interface Members
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Input: riid - Identifier of the interface being requested.
|
||||
// ppReturn - Address of the pointer variable that receives the interface pointer
|
||||
// requested in 'riid'. Upon successful return, 'ppReturn' contains
|
||||
// the requested interface pointer to the object. If the object does
|
||||
// not support the interface specified in 'riid', 'ppReturn' is set to NULL.
|
||||
// Returns: A pointer to an interface if successful, otherwise returns NULL.
|
||||
// Summary: The QueryInterface method gives a client access to other interfaces
|
||||
// on an object. For any one object, a specific query for the IUnknown
|
||||
// interface on any of the object's interfaces must always return the
|
||||
// same pointer value. This allows a client to determine whether two pointers
|
||||
// point to the same component by calling QueryInterface on both, and comparing
|
||||
// the results. It is specifically not the case that queries for interfaces
|
||||
// (even the same interface through the same pointer) must return the
|
||||
// same pointer value.
|
||||
STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppReturn);
|
||||
|
||||
// Returns: A ULONG value that represents the new reference count. The return value can be an
|
||||
// integer from 1 to n, the value of the new reference count. This information
|
||||
// is meant to be used for diagnostic and testing purposes only, because, in certain
|
||||
// situations, the value may be unstable.
|
||||
// Summary: The AddRef method increments the reference count for an interface on
|
||||
// an object. It should be called for every new copy of a pointer to
|
||||
// an interface on a given object.
|
||||
STDMETHODIMP_(ULONG) AddRef(void);
|
||||
|
||||
// Returns: A ULONG value that represents the resulting value of the reference count,
|
||||
// which is used for diagnostic and testing purposes only.
|
||||
// Summary: This method decrements the reference count for the calling interface
|
||||
// on a object. If the reference count on the object falls to 0, the object
|
||||
// is freed from memory.
|
||||
STDMETHODIMP_(ULONG) Release(void);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// IDropSource Interface Members
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: bEsc - Specifies whether the ESC key has been pressed since the previous
|
||||
// call to QueryContinueDrag, or to DoDragDrop if this is the first call
|
||||
// to QueryContinueDrag. A TRUE value indicates the end user has pressed
|
||||
// the escape key. A FALSE value indicates it has not been pressed.
|
||||
// dwKeyState - Current state of the keyboard modifier keys on the keyboard. Valid
|
||||
// values can be a combination of any of the flags MK_CONTROL, MK_SHIFT,
|
||||
// MK_ALT, MK_BUTTON, MK_LBUTTON, MK_MBUTTON, and MK_RBUTTON.
|
||||
// Returns: An HRESULT value.
|
||||
// Summary: This method determines whether a drag-and-drop operation should be
|
||||
// continued, canceled, or completed. You do not call this method directly.
|
||||
// The OLE DoDragDrop function calls this method during a drag-and-drop
|
||||
// operation. This method supports the standard return values E_UNEXPECTED
|
||||
// and E_OUTOFMEMORY, as well as the following:
|
||||
// [ul]
|
||||
// [li]<b>S_OK</b> Drag operation should continue. This result occurs if no
|
||||
// errors are detected, the mouse button starting the drag-and-drop
|
||||
// operation has not been released, and the ESC key has not been detected.[/li]
|
||||
// [li]<b>DRAGDROP_S_DROP</b> Drop operation should occur completing the drag
|
||||
// operation. This result occurs if DWORD indicates that the key that
|
||||
// started the drag-and-drop operation has been released.[/li]
|
||||
// [li]<b>DRAGDROP_S_CANCEL</b> Drag operation should be canceled with no drop
|
||||
// operation occurring. This result occurs if BOOL is TRUE, indicating
|
||||
// the ESC key has been pressed.[/li]
|
||||
// [/ul]
|
||||
STDMETHODIMP QueryContinueDrag(BOOL bEsc,DWORD dwKeyState);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: DWORD - Effect of a drop operation.
|
||||
// Returns: An HRESULT value.
|
||||
// Summary: This method enables a source application to give visual feedback to
|
||||
// the end user during a drag-and-drop operation by providing the DoDragDrop
|
||||
// function with an enumeration value specifying the visual effect. This
|
||||
// method supports the standard return values E_INVALIDARG, E_UNEXPECTED,
|
||||
// and E_OUTOFMEMORY, as well as the following:
|
||||
// [ul]
|
||||
// [li]<b>S_OK</b> Method completed its task successfully, using the cursor
|
||||
// set by the source application.[/li]
|
||||
// [li]<b>DRAGDROP_S_USEDEFAULTCURSORS</b> Successful completion of the method,
|
||||
// and requests OLE to update the cursor using the OLE-provided default
|
||||
// cursors.[/li]
|
||||
// [/ul]
|
||||
STDMETHODIMP GiveFeedback(DWORD);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // __XTDROPSOURCE_H__
|
||||
492
Editor/XT/Include/XTEditListBox.h
Normal file
492
Editor/XT/Include/XTEditListBox.h
Normal file
@@ -0,0 +1,492 @@
|
||||
// XTEditListBox.h interface for the CXTEditGroup class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTEDITLISTBOX_H__)
|
||||
#define __XTEDITLISTBOX_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTListBox is a CListBox derived class. CXTListBox extends the standard
|
||||
// list box control to enable flicker free drawing.
|
||||
class _XT_EXT_CLASS CXTListBox : public CListBox
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTListBox)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTListBox object.
|
||||
CXTListBox();
|
||||
|
||||
// Summary: Destroys a CXTListBox object, handles cleanup and de-allocation.
|
||||
virtual ~CXTListBox();
|
||||
|
||||
bool m_bAutoFont; // If true, the font will automatically be set for the control.
|
||||
bool m_bInitControl; // true for initialization.
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTListBox)
|
||||
public:
|
||||
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
|
||||
virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
|
||||
protected:
|
||||
virtual void PreSubclassWindow();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTListBox)
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
||||
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
// Summary: List used for enumerating XT_LOGFONT structures.
|
||||
typedef CList<XT_LOGFONT, XT_LOGFONT&> CXTFontList;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTFontEnum is a stand alone singleton font enumeration class. It is
|
||||
// used to enumerate a list of fonts found installed for the operating
|
||||
// system. CXTFontEnum is a singleton class, which means it can only be
|
||||
// instantiated a single time. The constructor is private, so the only
|
||||
// way to access members of this class is to use the objects Get() method,
|
||||
// to retrieve a list of available fonts for your operating system, you
|
||||
// would make the following call:
|
||||
//
|
||||
// <pre>CXTFontEnum::Get().GetFontList()</pre>
|
||||
class _XT_EXT_CLASS CXTFontEnum
|
||||
{
|
||||
// Summary: Constructs a CXTFontEnum object. CXTFontEnum is a singleton
|
||||
// class, to instantiate an object, use the static method Get().
|
||||
CXTFontEnum();
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Destroys a CXTFontEnum object, handles cleanup and de-allocation.
|
||||
virtual ~CXTFontEnum();
|
||||
|
||||
protected:
|
||||
|
||||
CXTFontList m_listFonts; // List of fonts found during enumeration.
|
||||
|
||||
public:
|
||||
|
||||
// Example: <pre>CXTFontEnum::Get().GetFontList()</pre>
|
||||
// Returns: A reference to a CXTFontEnum object.
|
||||
// Summary: This static member function will return a reference to the one
|
||||
// and only CXTFontEnum object. You can use this function to access
|
||||
// data members for the CXTFontEnum class.
|
||||
static CXTFontEnum& Get();
|
||||
|
||||
// Input: strFaceName - Reference to a NULL terminated string that represents the font name.
|
||||
// Returns: true if the font exists, otherwise returns false.
|
||||
// Summary: This member function is used to determine the existence of the font
|
||||
// specified by 'strFaceName'.
|
||||
bool DoesFontExist(CString& strFaceName);
|
||||
|
||||
// Input: strFaceName - A NULL terminated string that represents the font name.
|
||||
// Returns: A pointer to the XT_LOGFONT structure for the specified item, or NULL if no font
|
||||
// was found.
|
||||
// Summary: This member function is used to get a pointer to the font specified
|
||||
// by 'strFaceName'.
|
||||
XT_LOGFONT* GetLogFont(CString strFaceName);
|
||||
|
||||
// Returns: An integer value that represents the width for the longest font in the list.
|
||||
// Summary: This member function is used by the callback function to retrieve the
|
||||
// current width for the longest font name in the list.
|
||||
int GetMaxWidth();
|
||||
|
||||
// Returns: A reference to the CXTFontList used by this class.
|
||||
// Summary: This member function is used to get a reference to the font list.
|
||||
CXTFontList& GetFontList();
|
||||
|
||||
// Input: pDC - Points to a valid device context, if NULL, the screen device context
|
||||
// is used.
|
||||
// nCharSet - Represents the character set to enumerate.
|
||||
// Summary: This member function is called by the CXTFontEnum class to initialize
|
||||
// the font list. You can also call this member function to reinitialize
|
||||
// the font enumeration. For example, if you changed printers and you want
|
||||
// to enumerate printer fonts, or you wanted to use a different character
|
||||
// set.
|
||||
void Init(CDC* pDC=NULL,BYTE nCharSet=DEFAULT_CHARSET);
|
||||
|
||||
protected:
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: pelf - Pointer to an ENUMLOGFONTEX structure that contains information
|
||||
// about the logical attributes of the font.
|
||||
// lpntm - Pointer to a structure that contains information about the physical
|
||||
// attributes of a font. The function uses the NEWTEXTMETRICEX structure
|
||||
// for TrueType fonts; and the TEXTMETRIC structure for other fonts.
|
||||
// dwFontType - Specifies the type of the font. This parameter can be a combination
|
||||
// of these values:
|
||||
// [ul]
|
||||
// [li]<b>DEVICE_FONTTYPE</b> The font is a device font.
|
||||
// [li]<b>RASTER_FONTTYPE</b> The font is a raster font.
|
||||
// [li]<b>TRUETYPE_FONTTYPE</b> The font is a TrueType font.
|
||||
// [/ul]
|
||||
// lParam - Specifies the application-defined data passed by the EnumFontFamiliesEx
|
||||
// function.
|
||||
// Returns: The return value must be a nonzero value to continue enumeration.
|
||||
// To stop enumeration, the return value must be zero.
|
||||
// Summary: The EnumFontFamExProc function is an application defined<65>callback
|
||||
// function used with the EnumFontFamiliesEx function. It is used to process
|
||||
// the fonts. It is called once for each enumerated font. The FONTENUMPROC
|
||||
// type defines a pointer to this callback function. EnumFontFamExProc
|
||||
// is a placeholder for the application defined<65>function name.
|
||||
static BOOL CALLBACK EnumFontFamExProc(ENUMLOGFONTEX* pelf,NEWTEXTMETRICEX* lpntm,DWORD dwFontType,LPARAM lParam);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: pLF - Points to a valid LOGFONT structure.
|
||||
// dwType - Specifies the type of the font. This parameter can be a combination
|
||||
// of these values:
|
||||
// [ul]
|
||||
// [li]<b>DEVICE_FONTTYPE</b> The font is a device font.[/li]
|
||||
// [li]<b>RASTER_FONTTYPE</b> The font is a raster font.[/li]
|
||||
// [li]<b>TRUETYPE_FONTTYPE</b> The font is a TrueType font.[/li]
|
||||
// [/ul]
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function is called by the font enumeration callback to
|
||||
// add a font to the font list.
|
||||
bool AddFont(const LOGFONT* pLF,DWORD dwType);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE CXTFontList& CXTFontEnum::GetFontList() {
|
||||
return m_listFonts;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Summary: Enumerated style that is used to define how the font list box will display
|
||||
// the font listings.
|
||||
enum eSTYLE
|
||||
{
|
||||
XT_FLB_NAME_GUI = 0, // Display font name with GUI font style.
|
||||
XT_FLB_NAME_SAMPLE, // Display font name with its own font style.
|
||||
XT_FLB_BOTH, // Display font name with GUI font style, then a sample display to the right.
|
||||
};
|
||||
|
||||
// forwards
|
||||
|
||||
class CXTFontListBoxWndHook;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTFontListBox is a CXTListBox derived class. It is used to create
|
||||
// a font selection list box. You can choose to display the font name
|
||||
// with the GUI font style, display the font name with its own font style,
|
||||
// or display the font name with the default GUI font style and a sample
|
||||
// display to the right.
|
||||
class _XT_EXT_CLASS CXTFontListBox : public CXTListBox
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTFontListBox object.
|
||||
CXTFontListBox();
|
||||
|
||||
// Summary: Destroys a CXTFontListBox object, handles cleanup and de-allocation.
|
||||
virtual ~CXTFontListBox();
|
||||
|
||||
protected:
|
||||
|
||||
eSTYLE m_eStyle; // Enumerated style indicating how to display the font list.
|
||||
CString m_strSymbol; // String displayed for the symbol characters.
|
||||
CImageList m_ilFontType; // True type font image list.
|
||||
|
||||
public:
|
||||
|
||||
// Input: lf - Reference to an XT_LOGFONT structure.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to get the logfont for the currently selected
|
||||
// item.
|
||||
virtual bool GetSelFont(XT_LOGFONT& lf);
|
||||
|
||||
// Input: strFaceName - A reference to a valid CString object to receive the logfont face
|
||||
// name.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to get the logfont for the currently selected
|
||||
// item.
|
||||
virtual bool GetSelFont(CString& strFaceName);
|
||||
|
||||
// Input: lf - Reference to an XT_LOGFONT structure.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to select the logfont for the list box.
|
||||
virtual bool SetSelFont(XT_LOGFONT& lf);
|
||||
|
||||
// Input: strFaceName - A NULL terminated string that represents the logfont face name.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to select the logfont for the list box.
|
||||
virtual bool SetSelFont(CString strFaceName);
|
||||
|
||||
// Input: eStyle - Specifies the style for the font list box. Styles can be any one of
|
||||
// the following combinations:
|
||||
// [ul]
|
||||
// [li]<b>XT_FLB_NAME_GUI</b> Display font name in GUI font style.[/li]
|
||||
// [li]<b>XT_FLB_NAME_SAMPLE</b> Display font name with its own font
|
||||
// style.[/li]
|
||||
// [li]<b>XT_FLB_BOTH</b> Display font name in GUI font style, then
|
||||
// a sample display to the right.[/li]
|
||||
// [/ul]
|
||||
// Summary: Call this member function to set the font display style for the font
|
||||
// list box. There are three styles to choose from. They include displaying
|
||||
// the font in the default GUI font, displaying the font in its own font
|
||||
// style, or displaying both the font name in the default GUI font and
|
||||
// a sample to the right.
|
||||
void SetListStyle(eSTYLE eStyle);
|
||||
|
||||
// Summary: Call this member function to initialize the font list box and populate it
|
||||
// with a list of avaliable fonts.
|
||||
virtual void InitControl();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTFontListBox)
|
||||
public:
|
||||
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
|
||||
virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
|
||||
virtual int CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTFontListBox)
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTFontListBox::SetListStyle(eSTYLE eStyle) {
|
||||
m_eStyle = eStyle;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTEditGroup is a CStatic derived class. It used by the CXTEditListBox
|
||||
// class to create a toolbar above the edit list box to display icons for
|
||||
// editing. It can be used for other classes by setting the notify window
|
||||
// in Initialize. This window will receive notification messages whenever
|
||||
// the new, delete, up, and down buttons are pressed. You can handle these
|
||||
// messages by adding an ON_BN_CLICKED handler for each of the buttons
|
||||
// XT_IDC_BTN_NEW, XT_IDC_BTN_DELETE, XT_IDC_BTN_UP and XT_IDC_BTN_DOWN.
|
||||
class _XT_EXT_CLASS CXTEditGroup : public CStatic
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTEditGroup)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTEditGroup object.
|
||||
CXTEditGroup();
|
||||
|
||||
// Summary: Destroys a CXTEditGroup object, handles cleanup and de-allocation.
|
||||
virtual ~CXTEditGroup();
|
||||
|
||||
protected:
|
||||
|
||||
CWnd* m_pNotifyWnd; // Points to a CWnd object where notification messages are sent.
|
||||
CSize m_sizeBtn; // Initial size of the edit buttons.
|
||||
CRect m_rClip[4]; // Size of each button in the edit group.
|
||||
CXTButton m_btnNew; // New edit button.
|
||||
CXTButton m_btnDelete; // Delete edit button.
|
||||
CXTButton m_btnUp; // Move Up edit button.
|
||||
CXTButton m_btnDown; // Move Down edit button.
|
||||
CImageList m_ImageList; // Holds the images for the edit buttons.
|
||||
CToolTipCtrl m_tooltip; // Tooltip control for edit buttons.
|
||||
CXTIconHandle m_hIconDown; // Down button icon handle.
|
||||
CXTIconHandle m_hIconUp; // Up button icon handle.
|
||||
CXTIconHandle m_hIconDelete; // Delete button icon handle.
|
||||
CXTIconHandle m_hIconNew; // New button icon handle.
|
||||
|
||||
public:
|
||||
|
||||
// Input: pNotifyWnd - A CWnd object that represents the window that is to receive notification
|
||||
// messages.
|
||||
// Summary: This member function will initialize the edit group control.
|
||||
virtual void Initialize(CWnd* pNotifyWnd);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTEditGroup)
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual void MoveButtons();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTEditGroup)
|
||||
afx_msg void OnButtonNew();
|
||||
afx_msg void OnButtonDelete();
|
||||
afx_msg void OnButtonUp();
|
||||
afx_msg void OnButtonDown();
|
||||
afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnEnable(BOOL bEnable);
|
||||
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
// forwards
|
||||
|
||||
class CXTItemEdit;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTEditListBox is a CXTListBox derived class. It is used to create an
|
||||
// editable list box. This list box can be configured to display a toolbar
|
||||
// for editing. You can define browse styles to search for files or folders.
|
||||
// Each entry is made editable with a double mouse click.
|
||||
class _XT_EXT_CLASS CXTEditListBox : public CXTListBox
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTEditListBox)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTEditListBox object.
|
||||
CXTEditListBox();
|
||||
|
||||
// Summary: Destroys a CXTEditListBox object, handles cleanup and de-allocation.
|
||||
virtual ~CXTEditListBox();
|
||||
|
||||
// Input: lpszTitle - NULL terminated string that represents the caption title.
|
||||
// dwLStyle - Style for the list edit control. Pass in LBS_XT_NOTOOLBAR
|
||||
// if you do not wish the caption edit navigation control
|
||||
// bar to be displayed.
|
||||
// Summary: This member function will create the edit group control.
|
||||
void SetListEditStyle(LPCTSTR lpszTitle,DWORD dwLStyle=LBS_XT_DEFAULT);
|
||||
|
||||
// Input: nTitle - Resource ID of the string to load for the caption title.
|
||||
// dwLStyle - Style for the list edit control. Pass in LBS_XT_NOTOOLBAR
|
||||
// if you do not wish the caption edit navigation control
|
||||
// bar to be displayed.
|
||||
// Summary: This member function will create the edit group control.
|
||||
void SetListEditStyle(UINT nTitle,DWORD dwLStyle=0x0);
|
||||
|
||||
// Returns: An integer value that represents the edit control index.
|
||||
// Summary: Call this member function to get the current index for the edit control.
|
||||
// Similar to GetCurSel, however the current index is the index of the
|
||||
// last item to be modified or added to the edit list box, and not necessarily
|
||||
// the selected item.
|
||||
int GetCurrentIndex();
|
||||
|
||||
// Input: iItem - Index of the item to edit.
|
||||
// Summary: This member function will enable editing for the list box item.
|
||||
void EditItem(int iItem);
|
||||
|
||||
// Returns: A reference to a CXTEditGroup object.
|
||||
// Summary: Call this member function to return a reference to the CXTEditGroup
|
||||
// control that is associated with the edit list box.
|
||||
CXTEditGroup& GetEditGroup();
|
||||
|
||||
// Input: strFilter - Points to a NULL terminated string that represents the file filter
|
||||
// used by the file open dialog.
|
||||
// Summary: Call this member function to set the default filter for the file dialog.
|
||||
virtual void SetDlgFilter(LPCTSTR strFilter=NULL);
|
||||
|
||||
// Returns: true if the toolbar is turned on, otherwise returns false.
|
||||
// Summary: Call this member function to determine if the edit list has a toolbar.
|
||||
bool HasToolbar();
|
||||
|
||||
protected:
|
||||
|
||||
int m_nIndex; // Current index when edit functions are performed.
|
||||
bool m_bInitControl; // true for initialization.
|
||||
BOOL m_bNewItem; // TRUE if a new item is being entered into the list box.
|
||||
DWORD m_dwLStyle; // List edit styles.
|
||||
CString m_strTitle; // Caption area title.
|
||||
CString m_strFilter; // Default file filter.
|
||||
CString m_strItemText; // Current text of a selected item during edit.
|
||||
CXTItemEdit* m_pItemEdit; // Points to the in-place edit item.
|
||||
CXTEditGroup m_editGroup; // The edit group (toolbar) that appears above the list box.
|
||||
|
||||
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will create the edit group control.
|
||||
virtual BOOL CreateEditGroup();
|
||||
|
||||
// Input: bNewItem - TRUE to add a new item.
|
||||
// Summary: This member function will enable editing for the currently selected
|
||||
// list box item. If 'bNewItem' is TRUE, a new item is added to the end
|
||||
// of the list box.
|
||||
void EditListItem(BOOL bNewItem);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTEditListBox)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
virtual void PreSubclassWindow();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual void PositionEditGroup(bool bSizeList=false);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTEditListBox)
|
||||
afx_msg void OnEndLabelEdit();
|
||||
afx_msg void OnNewItem();
|
||||
afx_msg void OnDeleteItem();
|
||||
afx_msg void OnMoveItemUp();
|
||||
afx_msg void OnMoveItemDown();
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
|
||||
afx_msg void OnNcMButtonDown(UINT nHitTest, CPoint point);
|
||||
afx_msg void OnNcRButtonDown(UINT nHitTest, CPoint point);
|
||||
afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
|
||||
afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
|
||||
afx_msg void OnEnable(BOOL bEnable);
|
||||
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE int CXTEditListBox::GetCurrentIndex() {
|
||||
return m_nIndex;
|
||||
}
|
||||
AFX_INLINE CXTEditGroup& CXTEditListBox::GetEditGroup() {
|
||||
return m_editGroup;
|
||||
}
|
||||
AFX_INLINE void CXTEditListBox::SetDlgFilter(LPCTSTR strFilter/*=NULL*/) {
|
||||
m_strFilter = strFilter;
|
||||
}
|
||||
AFX_INLINE bool CXTEditListBox::HasToolbar() {
|
||||
return ((m_dwLStyle & LBS_XT_NOTOOLBAR) == 0);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTEDITLISTBOX_H__)
|
||||
373
Editor/XT/Include/XTFlatComboBox.h
Normal file
373
Editor/XT/Include/XTFlatComboBox.h
Normal file
@@ -0,0 +1,373 @@
|
||||
// XTFlatComboBox.h interface for the CXTFlatComboBox class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTFLATCOMBOBOX_H__)
|
||||
#define __XTFLATCOMBOBOX_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTFlatComboBox is a CComboBox derived class. The CXTFlatComboBox class
|
||||
// can easily give your application's standard CComboBox control the Flat
|
||||
// Look that is seen in many of the Microsoft® Office™ products. To use
|
||||
// the control, use Class Wizard to add the CComboBox member variable (
|
||||
// Class Wizard -> Member Variables Tab -> Add Variable ) and rename CComboBox
|
||||
// to CXTFlatComboBox.
|
||||
class _XT_EXT_CLASS CXTFlatComboBox : public CComboBox
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTFlatComboBox)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTFlatComboBox object.
|
||||
CXTFlatComboBox();
|
||||
|
||||
// Summary: Destroys a CXTFlatComboBox object, handles cleanup and de-allocation.
|
||||
virtual ~CXTFlatComboBox();
|
||||
|
||||
protected:
|
||||
|
||||
// Summary: This enum is used to determine the state the combo box should be.
|
||||
enum STATE
|
||||
{
|
||||
NORMAL = 1, // Value to display the combo box as normal.
|
||||
RAISED = 2, // Value to display the combo box as raised.
|
||||
PRESSED = 3 // Value to display the combo box as pressed.
|
||||
};
|
||||
|
||||
BOOL m_bLBtnDown; // TRUE if the left mouse button is pressed.
|
||||
BOOL m_bPainted; // Used during paint operations.
|
||||
BOOL m_bHasFocus; // TRUE if the control has focus.
|
||||
BOOL m_bAutoComp; // Used by Autocompleting.
|
||||
BOOL m_bFlatLook; // TRUE if the control is flat.
|
||||
BOOL m_bDisableAC; // TRUE when autocomplete is disabled internally.
|
||||
|
||||
public:
|
||||
|
||||
// Input: bDisable - TRUE to disable flat appearance.
|
||||
// Summary: This member function will disable the flat look for the combo box.
|
||||
void DisableFlatLook(BOOL bDisable);
|
||||
|
||||
// Returns: TRUE if the control is flat, otherwise returns FALSE.
|
||||
// Summary: Call this member function to determine if the combobox control's appearance is
|
||||
// flat.
|
||||
BOOL IsFlat();
|
||||
|
||||
// Input: bEnable - TRUE to enable auto completion, otherwise FALSE.
|
||||
// Summary: This member function enables or disables auto completion.
|
||||
virtual void EnableAutoCompletion(BOOL bEnable=TRUE);
|
||||
|
||||
// Returns: TRUE if the mouse is over the combo box, otherwise returns FALSE.
|
||||
// Summary: This member function determines if the mouse is within the control's
|
||||
// rect.
|
||||
virtual BOOL PointInRect();
|
||||
|
||||
protected:
|
||||
|
||||
// Input: pDC - Points to the current device context.
|
||||
// eState - Current state of the combo box, either NORMAL, RAISED, or PRESSED.
|
||||
// Summary: This member function is called by the combo box whenever a paint
|
||||
// operation should occur.
|
||||
virtual void DrawCombo(CDC* pDC,STATE eState);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTFlatComboBox)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual void RenderContent(CDC* pDC);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTFlatComboBox)
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnTimer(UINT_PTR nIDEvent);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnSetFocus();
|
||||
afx_msg void OnKillFocus();
|
||||
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
|
||||
afx_msg void OnEditUpdate();
|
||||
afx_msg void OnEndSel();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnPrintClient(WPARAM wp, LPARAM lp);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTFlatComboBox::EnableAutoCompletion(BOOL bEnable/*=TRUE*/) {
|
||||
ASSERT(::IsWindow(m_hWnd)); m_bAutoComp = bEnable;
|
||||
}
|
||||
AFX_INLINE BOOL CXTFlatComboBox::PointInRect() {
|
||||
ASSERT(::IsWindow(m_hWnd)); CPoint pt; GetCursorPos(&pt); CRect rcItem; GetWindowRect(&rcItem); return rcItem.PtInRect(pt);
|
||||
}
|
||||
AFX_INLINE BOOL CXTFlatComboBox::IsFlat() {
|
||||
return m_bFlatLook;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTEdit is a CEdit derived class. The CXTEdit class provides the functionality
|
||||
// of a Windows edit control. An edit control is a rectangular child window
|
||||
// in which the user can enter text.
|
||||
//
|
||||
// You can create an edit control either from a dialog template or directly
|
||||
// in your code. In both cases, first call the constructor CXTEdit to construct
|
||||
// the CXTEdit object, then call the Create member function to create the
|
||||
// Windows edit control and attach it to the CXTEdit object.
|
||||
//
|
||||
// Construction can be a one-step process in a class derived from CXTEdit.
|
||||
// Write a constructor for the derived class and call Create from within
|
||||
// the constructor.
|
||||
//
|
||||
// CXTEdit inherits significant functionality from CWnd. To set and retrieve
|
||||
// text from a CXTEdit object, use the CWnd member functions SetWindowText
|
||||
// and GetWindowText, which set or get the entire contents of an edit control,
|
||||
// even if it is a multiline control. Also, if an edit control is multiline,
|
||||
// get and set part of the control<6F>s text by calling the CXTEdit member
|
||||
// functions GetLine, SetSel, GetSel, and ReplaceSel.
|
||||
//
|
||||
// If you want to handle Windows notification messages sent by an edit
|
||||
// control to its parent (usually a class derived from CDialog), add a
|
||||
// message-map entry and message-handler member function to the parent
|
||||
// class for each message.
|
||||
//
|
||||
// Each message-map entry takes the following form:
|
||||
//
|
||||
// <pre>ON_Notification( id, memberFxn )</pre>
|
||||
//
|
||||
// where 'id' specifies the child window ID of the edit control sending the
|
||||
// notification, and 'memberFxn' is the name of the parent member function
|
||||
// you have written to handle the notification.
|
||||
//
|
||||
// The parent<6E>s function prototype is as follows:
|
||||
//
|
||||
// <pre>afx_msg void memberFxn( );</pre>
|
||||
//
|
||||
// Following is a list of potential message-map entries and a description
|
||||
// of the cases in which they would be sent to the parent:
|
||||
// [ul]
|
||||
// [li]<b>ON_EN_CHANGE</b> The user has taken an action that may have altered
|
||||
// text in an edit control. Unlike the EN_UPDATE notification message,
|
||||
// this notification message is sent after Windows updates the display.[/li]
|
||||
// [li]<b>ON_EN_ERRSPACE</b> The edit control cannot allocate enough memory
|
||||
// to meet a specific request.[/li]
|
||||
// [li]<b>ON_EN_HSCROLL</b> The user clicks an edit control<6F>s horizontal scroll
|
||||
// bar. The parent window is notified before the screen is updated.[/li]
|
||||
// [li]<b>ON_EN_KILLFOCUS</b> The edit control loses the input focus.[/li]
|
||||
// [li]<b>ON_EN_MAXTEXT</b> The current insertion has exceeded the specified
|
||||
// number of characters for the edit control and has been truncated.
|
||||
// Also sent when an edit control does not have the ES_AUTOHSCROLL
|
||||
// style and the number of characters to be inserted would exceed the
|
||||
// width of the edit control. Also sent when an edit control does not
|
||||
// have the ES_AUTOVSCROLL style and the total number of lines resulting
|
||||
// from a text insertion would exceed the height of the edit control.[/li]
|
||||
// [li]<b>ON_EN_SETFOCUS</b> Sent when an edit control receives the input focus.[/li]
|
||||
// [li]<b>ON_EN_UPDATE</b> The edit control is about to display altered text.
|
||||
// Sent after the control has formatted the text but before it screens
|
||||
// the text so that the window size can be altered, if necessary.[/li]
|
||||
// [li]<b>ON_EN_VSCROLL</b> The user clicks an edit control<6F>s vertical scroll
|
||||
// bar. The parent window is notified before the screen is updated.[/li]
|
||||
// [/ul]
|
||||
// If you create a CXTEdit object within a dialog box, the CXTEdit object
|
||||
// is automatically destroyed when the user closes the dialog box.
|
||||
//
|
||||
// If you create a CXTEdit object from a dialog resource using the dialog
|
||||
// editor, the CXTEdit object is automatically destroyed when the user
|
||||
// closes the dialog box.
|
||||
//
|
||||
// If you create a CXTEdit object within a window, you may also need to
|
||||
// destroy it. If you create the CXTEdit object on the stack, it is destroyed
|
||||
// automatically. If you create the CXTEdit object on the heap by using
|
||||
// the new function, you must call delete on the object to destroy it when
|
||||
// the user terminates the Windows edit control. If you allocate any memory
|
||||
// in the CXTEdit object, override the CXTEdit destructor to dispose of
|
||||
// the allocations.
|
||||
class _XT_EXT_CLASS CXTEdit : public CEdit
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTEdit)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTEdit object.
|
||||
CXTEdit();
|
||||
|
||||
// Summary: Destroys a CXTEdit object, handles clean up and de-allocation.
|
||||
virtual ~CXTEdit();
|
||||
|
||||
protected:
|
||||
|
||||
bool m_bInitInCreate; // true for initialization in OnCreate, set to true for dynamically created controls.
|
||||
CXTCoolMenu m_coolMenu; // Cool menu hook for this edit control.
|
||||
|
||||
public:
|
||||
|
||||
// Returns: TRUE if the Clipboard contains data in a format which this edit view can
|
||||
// accept, otherwise it returns FALSE.
|
||||
// Summary: Call this member function to determine if the Clipboard contains information
|
||||
// that can be pasted into this edit view.
|
||||
virtual BOOL CanPaste();
|
||||
|
||||
// Returns: TRUE if a selection has been made, otherwise returns FALSE.
|
||||
// Summary: Call this member function to determine if a selection has been made.
|
||||
virtual BOOL SelectionMade();
|
||||
|
||||
// Input: bInitInCreate - true to perform initialization in OnCreate.
|
||||
// Summary: Call this member function to set the initialization for the edit control.
|
||||
// If 'binitInCreate' is true, the edit control will perform initialization
|
||||
// in OnCreate, if false the edit control will perform initialization
|
||||
// in PreSubclassWindow. If your edit control is dynamically created
|
||||
// you should set this to true.
|
||||
void InitOnCreate(bool bInitInCreate);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTEdit)
|
||||
public:
|
||||
virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
|
||||
protected:
|
||||
virtual void PreSubclassWindow();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual void Init();
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTEdit)
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnContextMenu(CWnd*, CPoint point);
|
||||
afx_msg void OnEditUndo();
|
||||
afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
|
||||
afx_msg void OnEditCut();
|
||||
afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI);
|
||||
afx_msg void OnEditCopy();
|
||||
afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
|
||||
afx_msg void OnEditPaste();
|
||||
afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
|
||||
afx_msg void OnEditClear();
|
||||
afx_msg void OnUpdateEditClear(CCmdUI* pCmdUI);
|
||||
afx_msg void OnEditSelectAll();
|
||||
afx_msg void OnUpdateEditSelectAll(CCmdUI* pCmdUI);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTEdit::InitOnCreate(bool bInitInCreate) {
|
||||
m_bInitInCreate = bInitInCreate;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTFlatEdit is a CXTEdit derived class. The CXTFlatEdit class can easily
|
||||
// give your application's standard CEdit control the flat look that is
|
||||
// seen in many of the Microsoft® Office™ products. To use the control,
|
||||
// use Class Wizard to add the CEdit member variable ( Class Wizard ->
|
||||
// Member Variables Tab -> Add Variable ) and rename CEdit to CXTFlatEdit.
|
||||
class _XT_EXT_CLASS CXTFlatEdit : public CXTEdit
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTFlatEdit)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTFlatEdit object.
|
||||
CXTFlatEdit();
|
||||
|
||||
// Summary: Destroys a CXTFlatEdit object, handles cleanup and de-allocation.
|
||||
virtual ~CXTFlatEdit();
|
||||
|
||||
protected:
|
||||
|
||||
// Summary: This enum is used to determine the state the edit control should be.
|
||||
enum STATE
|
||||
{
|
||||
NORMAL = 1, // Value to make the edit control normal.
|
||||
RAISED = 2, // Value to make the edit control raised.
|
||||
};
|
||||
|
||||
BOOL m_bLBtnDown; // TRUE if the left mouse button is pressed.
|
||||
BOOL m_bHasFocus; // TRUE if the control has focus.
|
||||
BOOL m_bFlatLook; // TRUE if the control is flat.
|
||||
|
||||
public:
|
||||
|
||||
// Input: bDisable - TRUE to disable the flat appearance.
|
||||
// Summary: This member function will disable the flat look for the edit control.
|
||||
void DisableFlatLook(BOOL bDisable);
|
||||
|
||||
// Returns: TRUE if the control is flat, otherwise returns FALSE.
|
||||
// Summary: Call this member function to determine if the edit control's appearance is
|
||||
// flat.
|
||||
BOOL IsFlat();
|
||||
|
||||
// Returns: TRUE if the mouse is over the edit box, otherwise returns FALSE.
|
||||
// Summary: This member function determines if the mouse is within the control's
|
||||
// rect.
|
||||
virtual BOOL PointInRect();
|
||||
|
||||
protected:
|
||||
|
||||
// Input: pDC - Points to the current device context.
|
||||
// eState - Current state of the edit control, either NORMAL or RAISED.
|
||||
// Summary: This member function is called by the edit control whenever a paint
|
||||
// operation should occur.
|
||||
virtual void DrawEdit(CDC* pDC,STATE eState);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTFlatEdit)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual void RenderContent(CDC* pDC);
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTFlatEdit)
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnTimer(UINT_PTR nIDEvent);
|
||||
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
|
||||
afx_msg void OnSetFocus(CWnd* pOldWnd);
|
||||
afx_msg void OnKillFocus(CWnd* pNewWnd);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
AFX_INLINE BOOL CXTFlatEdit::PointInRect() {
|
||||
ASSERT(::IsWindow(m_hWnd)); CPoint pt; ::GetCursorPos(&pt); CRect rcItem; GetWindowRect(&rcItem); return rcItem.PtInRect(pt);
|
||||
}
|
||||
AFX_INLINE BOOL CXTFlatEdit::IsFlat() {
|
||||
return m_bFlatLook;
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTFLATCOMBOBOX_H__)
|
||||
325
Editor/XT/Include/XTFlatHeaderCtrl.h
Normal file
325
Editor/XT/Include/XTFlatHeaderCtrl.h
Normal file
@@ -0,0 +1,325 @@
|
||||
// XTFlatHeaderCtrl.h interface for the CXTFlatHeaderCtrl class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTFLATHEADERCTRL_H__)
|
||||
#define __XTFLATHEADERCTRL_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTHeaderCtrl is a CHeaderCtrl derived class. It is used to create
|
||||
// a CXTHeaderCtrl window similar to CHeaderCtrl, but with additional functionality.
|
||||
//
|
||||
// A <20>header control<6F> is a window usually positioned above columns of text
|
||||
// or numbers. It contains a title for each column, and it can be divided
|
||||
// into parts. The user can drag the dividers that separate the parts to
|
||||
// set the width of each column.
|
||||
//
|
||||
// Use a header control, represented by class CXTHeaderCtrl, to display
|
||||
// column headers for a columnar list. For example, a header control would
|
||||
// be useful for implementing column controls in a spreadsheet.
|
||||
//
|
||||
// The header control is usually divided into parts, called "header items,"
|
||||
// each bearing a title for the associated column of text or numbers. Depending
|
||||
// on the styles you set, you can provide a number of direct ways for users
|
||||
// to manipulate the header items.
|
||||
class _XT_EXT_CLASS CXTHeaderCtrl : public CHeaderCtrl
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTHeaderCtrl)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTHeaderCtrl object.
|
||||
CXTHeaderCtrl();
|
||||
|
||||
// Summary: Destroys a CXTHeaderCtrl object, handles cleanup and de-allocation.
|
||||
virtual ~CXTHeaderCtrl();
|
||||
|
||||
protected:
|
||||
|
||||
int m_iMinSize; // Minimum column size for an auto-size header control.
|
||||
bool m_bRTL; // Used internally to determine if text is right-to-left or left-to-right (depends on system locale).
|
||||
bool m_bAutoSize; // true if the header control columns are auto-sizing.
|
||||
CUIntArray m_arFrozenCols; // List of columns that are not sizable.
|
||||
|
||||
public:
|
||||
|
||||
// Input: bEnable - true to enable an auto-sizing header control.
|
||||
// Summary: Call this member function to enable auto-sizing for the header control.
|
||||
// This will cause the columns in the list control to be sized to fit
|
||||
// in the available space when the list control is resized.
|
||||
void EnableAutoSize(bool bEnable=true);
|
||||
|
||||
// Input: iCol - Index of the column to freeze.
|
||||
// Summary: Call this member function to freeze a column in the header control.
|
||||
// Freezing a column will disable sizing for the column.
|
||||
void FreezeColumn(int iCol);
|
||||
|
||||
// Input: iCol - Index of the column to thaw.
|
||||
// Summary: Call this member function to thaw a column in the header control.
|
||||
// Thawing a column will enable sizing for the column if it was previously
|
||||
// frozen.
|
||||
void ThawColumn(int iCol);
|
||||
|
||||
// Input: iCol - Index of the column to check.
|
||||
// Returns: true if the column is frozen, otherwise returns false.
|
||||
// Summary: Call this member function to determine if the specified column is
|
||||
// frozen.
|
||||
bool IsColFrozen(int iCol);
|
||||
|
||||
// Input: iMinSize - Minimum column size.
|
||||
// Summary: Call this member to set the minimum size for auto-sizing columns.
|
||||
// The minimum size represents the smallest size that all columns can
|
||||
// be sized to.
|
||||
void SetMinSize(int iMinSize);
|
||||
|
||||
protected:
|
||||
|
||||
// Returns: true if the text alignment is right-to-left, and false if the text
|
||||
// alignment is left-to-right.
|
||||
// Summary: This member function is used by the header control to determine
|
||||
// the text alignment for the system locale.
|
||||
virtual bool DetermineRTL();
|
||||
|
||||
// Input: iNewWidth - New width to resize all columns to.
|
||||
// Summary: This member function is used by the header control to auto-size the
|
||||
// columns for the list control.
|
||||
virtual void ApplyFieldWidths(int iNewWidth);
|
||||
|
||||
// Input: iNewWidth - New width to resize all columns to.
|
||||
// Summary: This member function is used by the header control to determine
|
||||
// the new width for auto-sized columns.
|
||||
virtual void FitFieldWidths(int iNewWidth);
|
||||
|
||||
// Returns: The combined size, in pixels, of all frozen columns.
|
||||
// Summary: This member function is used by the header control to determine
|
||||
// the total width of all frozen columns in the header control.
|
||||
virtual int GetFrozenColWidth();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTHeaderCtrl)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTHeaderCtrl)
|
||||
afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
|
||||
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg BOOL OnItemchanging(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTFlatHeaderCtrl is a CHeaderCtrl derived class. It is used to create
|
||||
// list box flat header controls that are similar to list box flat header
|
||||
// controls seen in Visual Studio&trade and Outlook™.
|
||||
class _XT_EXT_CLASS CXTFlatHeaderCtrl : public CXTHeaderCtrl
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTFlatHeaderCtrl)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTFlatHeaderCtrl object.
|
||||
CXTFlatHeaderCtrl();
|
||||
|
||||
// Summary: Destroys a CXTFlatHeaderCtrl object, handles cleanup and de-allocation.
|
||||
virtual ~CXTFlatHeaderCtrl();
|
||||
|
||||
protected:
|
||||
|
||||
int m_nPos; // Index of the popup menu contained in the menu.
|
||||
int m_nOffset; // Amount to offset the sort arrow.
|
||||
int m_nSortedCol; // Last column pressed during sort.
|
||||
UINT m_popupMenuID; // Popup menu resource ID.
|
||||
BOOL m_bLBtnDown; // TRUE if left mouse button is pressed.
|
||||
BOOL m_bAscending; // Used, when column is pressed, to draw a sort arrow.
|
||||
BOOL m_bSortArrow; // TRUE to draw a sort arrow.
|
||||
BOOL m_bEnableMenus; // TRUE to disable the popup menu display.
|
||||
bool m_bInitControl; // true for initialization.
|
||||
CPoint m_pt; // Point where right click took place.
|
||||
|
||||
public:
|
||||
|
||||
// Returns: TRUE if the header control displays a sort arrow, otherwise returns FALSE.
|
||||
// Summary: Call this member function to determine if the header control displays
|
||||
// a sort arrow.
|
||||
BOOL HasSortArrow();
|
||||
|
||||
// Input: popupMenuID - Resource ID for the popup menu used with the header.
|
||||
// nPos - Position of the submenu to be displayed.
|
||||
// Summary: This member function is called to associate a menu and toolbar
|
||||
// resource with the context menu.
|
||||
virtual void SetMenuID(UINT popupMenuID,int nPos=0);
|
||||
|
||||
// Input: bBoldFont - TRUE if the header's font should be bold.
|
||||
// Summary: This member function must be called after creation to initialize
|
||||
// the font the header will use.
|
||||
virtual void InitializeHeader(BOOL bBoldFont);
|
||||
|
||||
// Input: bBoldFont - TRUE if the header's font should be bold.
|
||||
// Summary: This member function can be used to toggle the font from bold to normal.
|
||||
virtual void SetFontBold(BOOL bBoldFont = TRUE);
|
||||
|
||||
// Input: nCol - Zero-based index of the column to set the sort image for.
|
||||
// bAsc - TRUE if ascending, otherwise FALSE.
|
||||
// Returns: A zero-based index of the previously sorted column.
|
||||
// Summary: This member function will set the sort image for the specified column.
|
||||
virtual int SetSortImage(int nCol,BOOL bAsc);
|
||||
|
||||
// Input: bSortArrow - Set to TRUE to draw the column sort arrow.
|
||||
// Summary: Call this member function to enable or disable the column sort arrow.
|
||||
virtual void ShowSortArrow(BOOL bSortArrow);
|
||||
|
||||
// Input: pt - Point to be tested.
|
||||
// Returns: The index of the item at the position specified by 'pt', otherwise returns -1.
|
||||
// Summary: This member function determines which header item, if any, is at
|
||||
// a specified cursor position.
|
||||
virtual int HitTest(CPoint pt) const;
|
||||
|
||||
// Input: nFlag - Text alignment, either LVCFMT_CENTER, LVCFMT_LEFT, or LVCFMT_RIGHT.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to set the text justification for the
|
||||
// header control.
|
||||
virtual BOOL SetAlingment(int nFlag);
|
||||
|
||||
// Returns: The index of the currently sorted column.
|
||||
// Summary: Call this member function to return the index to the currently sorted
|
||||
// column.
|
||||
int GetSortedCol() const;
|
||||
|
||||
// Returns: TRUE if the sorting order is ascending, otherwise returns FALSE.
|
||||
// Summary: Call this member function to return the current sorting order.
|
||||
BOOL GetAscending() const;
|
||||
|
||||
// Input: iCol - Zero-based index of the column to set the sort image for.
|
||||
// uBitmapID - Resource ID of the bitmap to use.
|
||||
// dwRemove - Style bits to be removed from the HD_ITEM::fmt variable. For
|
||||
// a column that does not display text, pass in HDF_STRING.
|
||||
// Summary: Call this member function to set the bitmap image for the specified
|
||||
// header item.
|
||||
void SetBitmap(int iCol,UINT uBitmapID,DWORD dwRemove=NULL);
|
||||
|
||||
// Input: bEnableMenus - TRUE to enable popup menus, and FALSE to disable.
|
||||
// Summary: Call this member function to enable or disable the popup menu display whenever
|
||||
// a user right clicks on the header control.
|
||||
void EnablePopupMenus(BOOL bEnableMenus);
|
||||
|
||||
protected:
|
||||
|
||||
// Input: pDC - Points to the current device context.
|
||||
// rect - Area to be drawn.
|
||||
// Summary: This member function is called by the header during paint operations.
|
||||
virtual void DrawBorders(CDC* pDC,CRect& rect);
|
||||
|
||||
#if _MSC_VER < 1200 // MFC 5.0
|
||||
|
||||
// Returns: The number of header control items, if successful, otherwise returns -1.
|
||||
// Summary: This member function retrieves a count of the items in a header
|
||||
// control.
|
||||
virtual int GetItemCount() const;
|
||||
|
||||
// Input: piArray - A pointer to the address of a buffer that receives the index
|
||||
// values of the items in the header control, in the order in which
|
||||
// they appear from left to right.
|
||||
// iCount - The number of header control items.
|
||||
// Summary: This member function retrieves the index values of the items in
|
||||
// the header control, in the order in which they appear from left to right.
|
||||
// If you use the default value of 'iCount', GetOrderArray fills the
|
||||
// parameter using GetItemCount. Returns nonzero if successful, otherwise,
|
||||
// it returns zero.
|
||||
virtual BOOL GetOrderArray(LPINT piArray,int iCount=-1);
|
||||
|
||||
// Input: nIndex - The zero-based index of the header control item.
|
||||
// lpRect - A pointer to the address of a RECT structure that receives the
|
||||
// bounding rectangle information.
|
||||
// Returns: Nonzero if successful, otherwise it returns zero.
|
||||
// Summary: This method implements the behavior of the Win32 message HDM_GETITEMRECT,
|
||||
// as described in the Platform SDK.
|
||||
virtual BOOL GetItemRect(int nIndex,LPRECT lpRect) const;
|
||||
#endif
|
||||
|
||||
// Input: iIndex - Index of the column to be sorted.
|
||||
// Summary: Called to send WM_NOTIFY to tell parent's owner that the column needs
|
||||
// to be sorted.
|
||||
void SendNotify(int iIndex);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTFlatHeaderCtrl)
|
||||
public:
|
||||
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
|
||||
protected:
|
||||
virtual void PreSubclassWindow();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTFlatHeaderCtrl)
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg void OnSortAsc();
|
||||
afx_msg void OnSortDsc();
|
||||
afx_msg void OnAlignLeft();
|
||||
afx_msg void OnAlignCenter();
|
||||
afx_msg void OnAlignRight();
|
||||
afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE BOOL CXTFlatHeaderCtrl::HasSortArrow() {
|
||||
return m_bSortArrow;
|
||||
}
|
||||
AFX_INLINE void CXTFlatHeaderCtrl::SetFontBold(BOOL bBoldFont) {
|
||||
ASSERT(::IsWindow(m_hWnd)); SetFont(bBoldFont?&xtAfxData.fontBold:&xtAfxData.font);
|
||||
}
|
||||
AFX_INLINE void CXTFlatHeaderCtrl::ShowSortArrow(BOOL bSortArrow) {
|
||||
ASSERT(::IsWindow(m_hWnd)); m_bSortArrow = bSortArrow; Invalidate();
|
||||
}
|
||||
AFX_INLINE int CXTFlatHeaderCtrl::GetSortedCol() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return m_nSortedCol;
|
||||
}
|
||||
AFX_INLINE BOOL CXTFlatHeaderCtrl::GetAscending() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return m_bAscending;
|
||||
}
|
||||
AFX_INLINE void CXTFlatHeaderCtrl::EnablePopupMenus(BOOL bEnableMenus) {
|
||||
m_bEnableMenus = bEnableMenus;
|
||||
}
|
||||
#if _MSC_VER < 1200 // MFC 5.0
|
||||
AFX_INLINE int CXTFlatHeaderCtrl::GetItemCount() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, HDM_GETITEMCOUNT, 0, 0L);
|
||||
}
|
||||
AFX_INLINE BOOL CXTFlatHeaderCtrl::GetItemRect(int nIndex, LPRECT lpRect) const {
|
||||
ASSERT(::IsWindow(m_hWnd)); ASSERT(lpRect != NULL); return (BOOL)::SendMessage(m_hWnd, HDM_GETITEMRECT, nIndex, (LPARAM)lpRect);
|
||||
}
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTFLATHEADERCTRL_H__)
|
||||
431
Editor/XT/Include/XTFlatTabCtrl.h
Normal file
431
Editor/XT/Include/XTFlatTabCtrl.h
Normal file
@@ -0,0 +1,431 @@
|
||||
// XTFlatTabCtrl.h interface for the CXTFlatTabCtrl class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTFLATTABCTRL_H__)
|
||||
#define __XTFLATTABCTRL_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTFlatTabCtrl is a CWnd derived class. It is used to create an Excel
|
||||
// style sheet control. This control allows you to define if you want the
|
||||
// control to have home, end, back, and next buttons.
|
||||
class _XT_EXT_CLASS CXTFlatTabCtrl : public CWnd
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTFlatTabCtrl)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTFlatTabCtrl object.
|
||||
CXTFlatTabCtrl();
|
||||
|
||||
// Summary: Destroys a CXTFlatTabCtrl object, handles cleanup and de-allocation.
|
||||
virtual ~CXTFlatTabCtrl();
|
||||
|
||||
protected:
|
||||
|
||||
int m_cx; // Width for each arrow button.
|
||||
int m_cy; // Height for each arrow button.
|
||||
int m_nCurSel; // Index of the currently selected tab.
|
||||
int m_nClientWidth; // Width, in pixels, of the tab control client area.
|
||||
int m_nClientHeight; // Height, in pixels, of the tab control client area.
|
||||
int m_nOffset; // Amount, in pixels, of the displayed tab offset.
|
||||
int m_xGripperPos; // The current gripper position, in pixels, from the left.
|
||||
int m_iGripperPosPerCent; // The current gripper position in percent of the control width.
|
||||
bool m_bManagingViews; // true if the control is managing views.
|
||||
bool m_bUserColors; // true if user defined colors are used.
|
||||
DWORD m_dwStyle; // Tab control style.
|
||||
CRect m_rectTabs; // Area occupied by tabs.
|
||||
CRect m_rectViews; // Area occupied by managed views.
|
||||
CRect m_rectSB_H; // Area occupied by the horizontal scroll bar.
|
||||
CRect m_rectGripper; // Area occupied by the sizing gripper.
|
||||
CFont* m_pNormFont; // Font that is used for non-selected tabs.
|
||||
CFont* m_pBoldFont; // Font that is used for selected tabs.
|
||||
COLORREF m_clr3DShadow; // RGB value that represents the tab shadow color.
|
||||
COLORREF m_clrBtnText; // RGB value that represents the tab outline color.
|
||||
COLORREF m_clr3DHilight; // RGB value that represents the tab highlight color.
|
||||
COLORREF m_clrWindow; // RGB value that represents the selected tab face color.
|
||||
COLORREF m_clr3DFace; // RGB value that represents the normal tab face color.
|
||||
COLORREF m_clrWindowText; // RGB value that represents the tab text color.
|
||||
CScrollBar m_wndHScrollBar; // The horizontal scroll bar (used with FTS_XT_HSCROLL).
|
||||
CToolTipCtrl m_ToolTip; // Tooltip for the flat tab control.
|
||||
|
||||
// Pens used by painting code
|
||||
|
||||
CPen m_penShadow;
|
||||
CPen m_penBackSel;
|
||||
CPen m_penBackNonSel;
|
||||
CPen m_penOutline;
|
||||
CPen m_penWindow;
|
||||
|
||||
// Summary: Template list containing tab information.
|
||||
CArray <XT_TCB_ITEM*, XT_TCB_ITEM*> m_tcbItems;
|
||||
|
||||
// Tracking related variables
|
||||
|
||||
bool m_bTracking;
|
||||
int m_xTrackingDelta;
|
||||
CWnd * m_pWndLastFocus;
|
||||
|
||||
// Summary: Enumerated type that specifies which arrow to display for a particular button.
|
||||
enum icon_type
|
||||
{
|
||||
arrow_left = 0x0200, // Left arrow display.
|
||||
arrow_left_home = 0x0201, // Left home arrow display.
|
||||
arrow_right = 0x0000, // Right arrow display.
|
||||
arrow_right_home = 0x0001 // Right home arrow display.
|
||||
};
|
||||
|
||||
// Internal structures/variables used to control button information
|
||||
|
||||
class CXTFTButtonState
|
||||
{
|
||||
public:
|
||||
CXTFTButtonState();
|
||||
|
||||
void SetInfo(CRect rect, int iCommand, icon_type iconType);
|
||||
|
||||
CRect m_rect;
|
||||
bool m_bPressed;
|
||||
bool m_bEnabled;
|
||||
int m_iCommand;
|
||||
icon_type m_IconType;
|
||||
};
|
||||
|
||||
int m_iBtnLeft; // Index of "left" button in button array.
|
||||
int m_iBtnRight; // Index of "right" button in button array.
|
||||
int m_iBtnHome; // Index of "home" button in button array.
|
||||
int m_iBtnEnd; // Index of "end" button in button array.
|
||||
CXTFTButtonState m_buttons[4]; // Array of button information.
|
||||
|
||||
public:
|
||||
|
||||
// Input: nIndex - The index of the tab whose text is to be retrieved.
|
||||
// Returns: The text of a particular tab, or NULL if an error occurs.
|
||||
// Summary: This member function gets the text of a specific tab.
|
||||
LPCTSTR GetItemText(int nIndex) const;
|
||||
|
||||
// Input: nIndex - The index of the tab whose text is to be changed.
|
||||
// pszText - The new title for the tab.
|
||||
// Returns: true when successful.
|
||||
// Summary: This member function will set the text of a particular tab.
|
||||
bool SetItemText(int nIndex,LPCTSTR pszText);
|
||||
|
||||
// Input: nIndex - The index of the tab whose managed window is to be retrieved.
|
||||
// Returns: A pointer to the window that is associated with a tab, or it returns NULL
|
||||
// if no window is associated with (managed by) the tab.
|
||||
// Summary: This member function gets a CWnd pointer to the window that is associated
|
||||
// with a specific tab.
|
||||
CWnd *GetItemWindow(int nIndex) const;
|
||||
|
||||
// Input: pNormFont - Represents the font used by non-selected tabs.
|
||||
// pBoldFont - Represents the font used by selected tabs.
|
||||
// Summary: This member function will set the fonts to be used by the tab control.
|
||||
virtual void SetTabFonts(CFont* pNormFont,CFont* pBoldFont);
|
||||
|
||||
// Input: nItem - Index of the tab to insert.
|
||||
// nTextID - String resource ID of the tab label.
|
||||
// pWndControl - Optional pointer to the managed control.
|
||||
// Returns: The index of the tab that has been inserted if successful, otherwise
|
||||
// returns -1.
|
||||
// Summary: This member function will insert a tab into the flat tab control.
|
||||
virtual int InsertItem(int nItem,UINT nTextID,CWnd *pWndControl = NULL);
|
||||
|
||||
// Input: nItem - Index of the tab to insert.
|
||||
// lpszItem - NULL terminated string that represents the tab label.
|
||||
// pWndControl - Optional pointer to the managed control.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will insert a tab into the flat tab control.
|
||||
virtual BOOL InsertItem(int nItem,LPCTSTR lpszItem,CWnd *pWndControl = NULL);
|
||||
|
||||
// Input: nItem - Index of the tab to delete.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will delete the tab specified by 'nItem' from the
|
||||
// tab control.
|
||||
virtual BOOL DeleteItem(int nItem);
|
||||
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will remove all of the tabs from the tab control.
|
||||
virtual BOOL DeleteAllItems();
|
||||
|
||||
// Input: nItem - Index of the tab to retrieve the size of.
|
||||
// lpRect - Points to a RECT structure to receive the size of the tab.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will retrieve the size of the tab specified by
|
||||
// 'nItem'.
|
||||
virtual BOOL GetItemRect(int nItem,LPRECT lpRect);
|
||||
|
||||
// Input: pHitTestInfo - Pointer to a TCHITTESTINFO structure, as
|
||||
// described in the Platform SDK, which specifies
|
||||
// the screen position to test.
|
||||
// Returns: The zero-based index of the tab, or returns -1 if no tab is at the specified
|
||||
// position.
|
||||
// Summary: Call this function to determine which tab, if any, is at the specified
|
||||
// screen position.
|
||||
virtual int HitTest(TCHITTESTINFO *pHitTestInfo) const;
|
||||
|
||||
// Returns: A zero-based index of the selected tab if successful, or returns -1 if no tab
|
||||
// is selected.
|
||||
// Summary: Call this function to retrieve the currently selected tab in a flat
|
||||
// tab control.
|
||||
virtual int GetCurSel() const;
|
||||
|
||||
// Input: nItem - The zero-based index of the item to be selected.
|
||||
// Returns: A zero-based index of the previously selected tab if successful, otherwise
|
||||
// returns -1.
|
||||
// Summary: This member function selects a tab in a flat tab control.
|
||||
virtual int SetCurSel(int nItem);
|
||||
|
||||
// Returns: The number of items in the tab control.
|
||||
// Summary: Call this function to retrieve the number of tabs in the tab control.
|
||||
virtual int GetItemCount() const;
|
||||
|
||||
// Input: nItem - The zero-based index of tab to receive the tooltip text.
|
||||
// lpszTabTip - A pointer to a string containing the tooltip text.
|
||||
// Summary: This member function will set the tooltip for the tab specified
|
||||
// by 'nItem'.
|
||||
virtual void SetTipText(int nItem,LPCTSTR lpszTabTip);
|
||||
|
||||
// Input: nItem - The zero-based index of the tab to retrieve the tooltip
|
||||
// text for.
|
||||
// Returns: A CString object containing the text to be used in the tooltip.
|
||||
// Summary: This member function will get the tooltip text associated with the
|
||||
// tab specified by 'nItem'.
|
||||
virtual CString GetTipText(int nItem);
|
||||
|
||||
// Summary: This member function will cause the tab control to reposition
|
||||
// the tabs to the home position.
|
||||
virtual void Home();
|
||||
|
||||
// Input: x - The position for the gripper, relative to the left-hand-side of
|
||||
// the control.
|
||||
// bPercent - Indicates that the position is a percent of the control width,
|
||||
// as opposed to an absolute location in pixels.
|
||||
// Summary: This member function changes the location of the sizing gripper.
|
||||
// The function has no effect if the FTS_XT_HSCROLL is not used.
|
||||
void SetGripperPosition(int x,bool bPercent);
|
||||
|
||||
// Returns: An integer value representing the location of the sizing gripper, in pixels,
|
||||
// relative to the left hand side of the control.
|
||||
// Summary: This member function gets the location of the sizing gripper, in pixels,
|
||||
// relative to the left hand side of the control.
|
||||
int GetGripperPosition() const;
|
||||
|
||||
// Summary: Call this function to synchronize the tab control's horizontal scroll
|
||||
// bar with the horizontal scroll bar of the current view.
|
||||
//
|
||||
// You should call this function if anything happens in the view that
|
||||
// affects the horizontal scroll bar (e.g. a user typing text into an
|
||||
// edit control could make the text wider, thus requiring a call to this
|
||||
// function).
|
||||
void SyncScrollBar();
|
||||
|
||||
// Input: crShadow - RGB value that represents the tab shadow color.
|
||||
// Summary: This member function is called to set the shadow color for all tabs.
|
||||
void SetTabShadowColor(COLORREF crShadow);
|
||||
|
||||
// Returns: An RGB value that represents the tab shadow color.
|
||||
// Summary: This member function gets an RGB value that represents the shadow color
|
||||
// of the tab.
|
||||
COLORREF GetTabShadowColor() const;
|
||||
|
||||
// Input: crHilight - RGB value that represents the tab highlight color.
|
||||
// Summary: This member function is called to set the highlight color for all tabs.
|
||||
void SetTabHilightColor(COLORREF crHilight);
|
||||
|
||||
|
||||
// Returns: An RGB value that represents the tab highlight color.
|
||||
// Summary: This member function gets an RGB value that represents the highlight
|
||||
// color of the tab.
|
||||
COLORREF GetTabHilightColor() const;
|
||||
|
||||
// Input: crBack - RGB value that represents the tab background color.
|
||||
// Summary: This member function is called to set the background color for normal tabs.
|
||||
void SetTabBackColor(COLORREF crBack);
|
||||
|
||||
// Returns: An RGB value that represents the tab background color.
|
||||
// Summary: This member function gets an RGB value that represents the background
|
||||
// color of the tab.
|
||||
COLORREF GetTabBackColor() const;
|
||||
|
||||
// Input: crText - RGB value that represents the tab text color.
|
||||
// Summary: This member function is called to set the text color for normal tabs.
|
||||
void SetTabTextColor(COLORREF crText);
|
||||
|
||||
// Returns: An RGB value that represents the tab text color.
|
||||
// Summary: This member function gets an RGB value that represents the text color
|
||||
// of the tab.
|
||||
COLORREF GetTabTextColor() const;
|
||||
|
||||
// Input: crBack - RGB value that represents the selected tab background color.
|
||||
// Summary: This member function is called to set the background color for selected tabs.
|
||||
void SetSelTabBackColor(COLORREF crBack);
|
||||
|
||||
// Returns: An RGB value that represents the selected tabs background color.
|
||||
// Summary: This member function gets an RGB value that represents the background
|
||||
// color for selected tabs.
|
||||
COLORREF GetSelTabBackColor() const;
|
||||
|
||||
// Input: crText - RGB value that represents the selected tab text color.
|
||||
// Summary: This member function is called to set the text color for selected tabs.
|
||||
void SetSelTabTextColor(COLORREF crText);
|
||||
|
||||
// Returns: An RGB value that represents the selected tab text color.
|
||||
// Summary: This member function gets an RGB value that represents the text color
|
||||
// for selected tabs.
|
||||
COLORREF GetSelTabTextColor() const;
|
||||
|
||||
// Summary: Call this member function to reset the tab control to use default system colors.
|
||||
void UpdateDefaultColors();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTFlatTabCtrl)
|
||||
virtual BOOL Create(DWORD dwStyle, const CRect& rect, CWnd* pParentWnd, UINT nID);
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
virtual BOOL OnNotify(WPARAM, LPARAM lParam, LRESULT* pResult);
|
||||
virtual CScrollBar* GetScrollBarCtrl(int nBar) const;
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Input: pt - A CPoint reference representing the specified screen position.
|
||||
// Returns: The zero-based index of the button within the button's array or -1 if no
|
||||
// button is at the specified position.
|
||||
// Summary: Call this function to determine which button, if any, is at the specified
|
||||
// screen position.
|
||||
virtual int ButtonHitTest(CPoint& pt) const;
|
||||
|
||||
// Input: nItem - The zero-based index of the tab to retrieve the width for.
|
||||
// Returns: The width, in pixels, of the tab.
|
||||
// Summary: This member function will get the width, in pixels, of the tab specified
|
||||
// by 'nItem'.
|
||||
int GetTabWidth(int nItem) const;
|
||||
|
||||
// Returns: The total combined width, in pixels, of all the tabs in the control.
|
||||
// Summary: This member function will return the total width of all of the tabs
|
||||
// in the flat tab control.
|
||||
int GetTotalTabWidth() const;
|
||||
|
||||
// Returns: The total width, in pixels, of all the visible arrow buttons.
|
||||
// Summary: This member function will return the total width of all of the arrow
|
||||
// buttons that are visible in the flat tab control.
|
||||
int GetTotalArrowWidth() const;
|
||||
|
||||
// Returns: The total area width, in pixels, of all the tabs in the flat tab control.
|
||||
// Summary: This member function will return the total area width of all of the
|
||||
// tabs in the flat tab control.
|
||||
int GetTotalTabAreaWidth() const;
|
||||
|
||||
// Input: pDC - Points to the device context to draw the tab to.
|
||||
// pt - XY location of the top left corner of the tab to draw.
|
||||
// bSelected - true if the tab is currently selected.
|
||||
// lpszTabLabel - A NULL terminated string that represents the tab label.
|
||||
// Returns: The x position of the next tab to be drawn.
|
||||
// Summary: This member function will draw a tab to the device context specified
|
||||
// by 'pDC'.
|
||||
int DrawTab(CDC* pDC,const CPoint& pt,bool bSelected,LPCTSTR lpszTabLabel);
|
||||
|
||||
// Input: pDC - Points to the device context to draw the tab to.
|
||||
// button_state - XY location of the top left corner of the tab to draw.
|
||||
// Summary: This member function is used by the flat tab control to draw an arrow
|
||||
// button to the device context specified by 'pDC'.
|
||||
void DrawButton(CDC* pDC,CXTFTButtonState& button_state) const;
|
||||
|
||||
// Summary: This member function will force all of the tabs to be repainted.
|
||||
void InvalidateTabs();
|
||||
|
||||
// Summary: This member function will enable or disable the arrow buttons
|
||||
// depending on the current tab display state.
|
||||
void EnableButtons();
|
||||
|
||||
// Summary: This member function will free the resources allocated for the
|
||||
// icons used by the arrow buttons.
|
||||
void FreeButtonIcons();
|
||||
|
||||
// Summary: This member function will create the icon resources that are
|
||||
// used by the arrow buttons.
|
||||
void CreateButtonIcons();
|
||||
|
||||
// Input: pDC - Points to the device context to draw the gripper to.
|
||||
// rect - Location of the gripper.
|
||||
// Summary: This member function will draw the horizontal sizing gripper at a
|
||||
// specified location.
|
||||
void DrawGripper(CDC* pDC,CRect rect) const;
|
||||
|
||||
// Input: bTracking - true to enable tracking, or false to disable tracking.
|
||||
// Summary: The member function is used internally to toggle the state of the
|
||||
// sizing-grip tracking mode.
|
||||
void SetTracking(bool bTracking);
|
||||
|
||||
// Summary: This member function frees all memory occupied by the tab items.
|
||||
void ClearAllItems();
|
||||
|
||||
// Summary: This member function is called when the tab control is resized. It
|
||||
// is responsible for updating internal structures which are dependant
|
||||
// on the control's size.
|
||||
void RecalcLayout();
|
||||
|
||||
// Input: nItem - Index of the tab to delete.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This internal function deletes an item from the tab item list.
|
||||
virtual BOOL _DeleteItem(int nItem);
|
||||
|
||||
// Returns: An integer value that represents the overlap between the tabs.
|
||||
// Summary: This internal function calculates the overlap between two tabs.
|
||||
virtual int GetOverlap() const;
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTFlatTabCtrl)
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnLeftArrow();
|
||||
afx_msg void OnRightArrow();
|
||||
afx_msg void OnHomeArrow();
|
||||
afx_msg void OnEndArrow();
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
|
||||
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
||||
afx_msg void OnSysColorChange();
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE BOOL CXTFlatTabCtrl::InsertItem(int nItem, UINT nTextID, CWnd *pWndControl) {
|
||||
ASSERT(IsWindow(m_hWnd)); CString strItem; strItem.LoadString(nTextID); return InsertItem(nItem, strItem, pWndControl);
|
||||
}
|
||||
AFX_INLINE int CXTFlatTabCtrl::GetCurSel() const {
|
||||
ASSERT(IsWindow(m_hWnd)); return m_nCurSel;
|
||||
}
|
||||
AFX_INLINE int CXTFlatTabCtrl::GetItemCount() const {
|
||||
ASSERT(IsWindow(m_hWnd)); int iItemCount = (int)m_tcbItems.GetSize(); return iItemCount;
|
||||
}
|
||||
AFX_INLINE void CXTFlatTabCtrl::SetTabFonts(CFont* pNormFont, CFont* pBoldFont) {
|
||||
if (pNormFont){ m_pNormFont = pNormFont; } if (pBoldFont){ m_pBoldFont = pBoldFont; }
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTFLATTABCTRL_H__)
|
||||
122
Editor/XT/Include/XTFontCombo.h
Normal file
122
Editor/XT/Include/XTFontCombo.h
Normal file
@@ -0,0 +1,122 @@
|
||||
// XTFontCombo.h interface for the CXTFontCombo class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTFONTCOMBO_H__)
|
||||
#define __XTFONTCOMBO_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTFontCombo is a CXTFlatComboBox derived class. It is used to create
|
||||
// a combo box that displays a drop list of available fonts for your system.
|
||||
// The fonts are displayed in their various styles.
|
||||
class _XT_EXT_CLASS CXTFontCombo : public CXTFlatComboBox
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTFontCombo)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTFontCombo object.
|
||||
CXTFontCombo();
|
||||
|
||||
// Summary: Destroys a CXTFontCombo object, handles cleanup and de-allocation.
|
||||
virtual ~CXTFontCombo();
|
||||
|
||||
protected:
|
||||
|
||||
int m_cyHScroll; // Represents system metrics for SM_CYHSCROLL.
|
||||
int m_cyEdge; // Represents system metrics for SM_CYEDGE.
|
||||
eSTYLE m_eStyle; // Enumerated style indicating how to display the font list.
|
||||
CString m_strSymbol; // String displayed for symbol characters.
|
||||
CImageList m_ilFontType; // true type font image list.
|
||||
|
||||
public:
|
||||
|
||||
// Input: lf - Reference to an XT_LOGFONT structure.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to get the logfont for the currently selected
|
||||
// item.
|
||||
virtual bool GetSelFont(XT_LOGFONT& lf);
|
||||
|
||||
// Input: strFaceName - A reference to a valid CString object to receive the logfont face
|
||||
// name.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to get the logfont for the currently selected
|
||||
// item.
|
||||
virtual bool GetSelFont(CString& strFaceName);
|
||||
|
||||
// Input: lf - Reference to an XT_LOGFONT structure.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to select the logfont for the list box.
|
||||
virtual bool SetSelFont(XT_LOGFONT& lf);
|
||||
|
||||
// Input: strFaceName - A NULL terminated string that represents the logfont face name.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to select the logfont for the list box.
|
||||
virtual bool SetSelFont(CString strFaceName);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: eStyle - Specifies the style for the font list box. Styles can be any one of
|
||||
// the following combinations:
|
||||
// [ul]
|
||||
// [li]<b>XT_FLB_NAME_GUI</b> Display font name with GUI font style.[/li]
|
||||
// [li]<b>XT_FLB_NAME_SAMPLE</b> Display font name with its own font
|
||||
// style.[/li]
|
||||
// [li]<b>XT_FLB_BOTH</b> Display font name with GUI font style, then
|
||||
// a sample display to the right.[/li]
|
||||
// [/ul]
|
||||
// Summary: Call this member function to set the font display style for the font
|
||||
// list box. There are three styles to choose from. They include displaying
|
||||
// the font in the default GUI font, displaying the font in its own font
|
||||
// style, or displaying both the font name in the default GUI font and
|
||||
// a sample to the right.
|
||||
void SetListStyle(eSTYLE eStyle);
|
||||
|
||||
// Input: lpszFaceName - A NULL terminated string that represents the logfont face name.
|
||||
// nWidth - The minimum allowable width of the list box portion of the combo
|
||||
// box, in pixels.
|
||||
// bEnable - TRUE to enable autocompletion, otherwise FALSE.
|
||||
// Summary: Call this member function to initialize the font list box and populate it
|
||||
// with a list of avaliable fonts.
|
||||
virtual void InitControl(LPCTSTR lpszFaceName=NULL,UINT nWidth=0,BOOL bEnable=TRUE );
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTFontCombo)
|
||||
public:
|
||||
virtual void DrawItem(LPDRAWITEMSTRUCT);
|
||||
virtual void MeasureItem(LPMEASUREITEMSTRUCT);
|
||||
virtual int CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTFontCombo)
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTFontCombo::SetListStyle(eSTYLE eStyle) {
|
||||
m_eStyle = eStyle;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTFONTCOMBO_H__)
|
||||
310
Editor/XT/Include/XTFrameImpl.h
Normal file
310
Editor/XT/Include/XTFrameImpl.h
Normal file
@@ -0,0 +1,310 @@
|
||||
// XTFrameImpl.h interface for the CXTFrameImpl class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTFRAMEIMPL_H__)
|
||||
#define __XTFRAMEIMPL_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
// forwards
|
||||
|
||||
class CXTDockState;
|
||||
class CXTCustomizeSheet;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTFrameImpl is a stand alone helper class. It is used to provide additional
|
||||
// support for cool menu and other control bar functionality. It is an
|
||||
// additional base class for CXTFrameWnd, CXTMDIChildWnd, CXTMDIFrameWnd,
|
||||
// and CXTOleIPFrameWnd.
|
||||
class _XT_EXT_CLASS CXTFrameImpl
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTFrameImpl object.
|
||||
CXTFrameImpl();
|
||||
|
||||
// Summary: Destroys a CXTFrameImpl object, handles cleanup and de-allocation.
|
||||
virtual ~CXTFrameImpl();
|
||||
|
||||
CXTCoolMenu m_coolMenu; // Handles the display of old-style 'cool' menus.
|
||||
|
||||
protected:
|
||||
|
||||
CXTMenuBar m_wndMenuBar; // Menu bar.
|
||||
static DWORD m_dwCustStyle; // Customize dialog style, you can set this style in your frame's constructor, see CXTCustomizeSheet for more details.
|
||||
static CXTCustomizeSheet* m_pCustomizeSheet; // Pointer to the toolbar customize dialog.
|
||||
|
||||
protected:
|
||||
|
||||
// Input: pFrameWnd - A CFrameWnd pointer to the calling frame window.
|
||||
// Returns: A CXTCoolMenu pointer to the cool menu object associated with the frame.
|
||||
// Summary: Call this member function to retrieve a pointer to the cool menu object
|
||||
// associated with the frame.
|
||||
CXTCoolMenu* GetCoolMenuImpl(CFrameWnd* pFrameWnd);
|
||||
|
||||
// Input: pFrameWnd - A CFrameWnd pointer to the calling frame window.
|
||||
// Returns: A CXTMenuBar pointer to the menu bar associated with the frame.
|
||||
// Summary: Call this member function to retrieve a pointer to the application's
|
||||
// menu bar. To use this function, the menu bar must have been created using
|
||||
// the default control ID AFX_IDW_MENUBAR.
|
||||
CXTMenuBar* GetMenuBarImpl(CFrameWnd* pFrameWnd) const;
|
||||
|
||||
// Input: nIDToolBars - Array of toolbar resource IDs. The cool menu will use the toolbar
|
||||
// commands to map the icons placed next to the corresponding menu commands.
|
||||
// nSize - Size of the array of toolbars.
|
||||
// pFrameWnd - A CFrameWnd pointer to the calling frame window.
|
||||
// Summary: Call this member function to install cool menus for your application.
|
||||
// Cool menus are menus that appear with icons next to the menu titles.
|
||||
// Pass in your toolbar resource array to initialize.
|
||||
void InstallCoolMenusImpl(const UINT* nIDToolBars,int nSize,CFrameWnd* pFrameWnd);
|
||||
|
||||
// Input: nIDToolBar - Toolbar resource ID. The cool menu will use the toolbar commands
|
||||
// to map the icons placed next to the corresponding menu commands.
|
||||
// pFrameWnd - A CFrameWnd pointer to the calling frame window.
|
||||
// Summary: Call this member function to install cool menus for your application.
|
||||
// Cool menus are menus that appear with icons next to the menu titles.
|
||||
// Pass in your toolbar resource to initialize.
|
||||
void InstallCoolMenusImpl(const UINT nIDToolBar,CFrameWnd* pFrameWnd);
|
||||
|
||||
// Input: lpszProfileName - Name of a section in the initialization file or a key in the Windows
|
||||
// registry where state information is stored.
|
||||
// pFrameWnd - A CFrameWnd pointer to the calling frame window.
|
||||
// Summary: This member function is called by the frame window to restore the
|
||||
// settings of the control bar.
|
||||
void LoadBarStateImpl(LPCTSTR lpszProfileName,CFrameWnd* pFrameWnd);
|
||||
|
||||
// Input: lpszProfileName - Name of a section in the initialization file or a key in the Windows
|
||||
// registry where state information is stored.
|
||||
// pFrameWnd - A CFrameWnd pointer to the calling frame window.
|
||||
// Summary: This member function is called by the frame window to save the settings
|
||||
// of the control bar.
|
||||
void SaveBarStateImpl(LPCTSTR lpszProfileName,CFrameWnd* pFrameWnd) const;
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwDockStyle - Specifies whether the control bar supports docking and the sides of
|
||||
// its parent window to which the control bar can be docked, if supported.
|
||||
// The style can be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_ALIGN_TOP</b> Allows docking at the top of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_BOTTOM</b> Allows docking at the bottom of
|
||||
// the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_LEFT</b> Allows docking on the left side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_RIGHT</b> Allows docking on the right side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_ANY</b> Allows docking on any side of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_FLOAT_MULTI</b> Allows multiple control bars to
|
||||
// be floated in a single mini-frame window.[/li]
|
||||
// [/ul]
|
||||
// If 0 (that is, indicating no flags), the control bar will not dock.
|
||||
// pFrameWnd - A CFrameWnd pointer to the calling frame window.
|
||||
// Summary: Call this function to enable a control bar to be docked. The sides
|
||||
// specified must match one of the sides enabled for docking in the destination
|
||||
// frame window, or the control bar cannot be docked to that frame window.
|
||||
void EnableDockingImpl(DWORD dwDockStyle,CFrameWnd* pFrameWnd);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwDockStyle - Specifies whether the control bar supports docking and the sides of
|
||||
// its parent window to which the control bar can be docked, if supported.
|
||||
// The style can be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_ALIGN_TOP</b> Allows docking at the top of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_BOTTOM</b> Allows docking at the bottom of
|
||||
// the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_LEFT</b> Allows docking on the left side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_RIGHT</b> Allows docking on the right side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_ANY</b> Allows docking on any side of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_FLOAT_MULTI</b> Allows multiple control bars to
|
||||
// be floated in a single mini-frame window.[/li]
|
||||
// [/ul]
|
||||
// If 0 (that is, indicating no flags), the control bar will not dock.
|
||||
// dwFlatStyle - Specifies the splitter's, inside dockbars, look. The style can be
|
||||
// one of the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_XT_NONFLAT</b> Thick devstudio like non-flat splitters.[/li]
|
||||
// [li]<b>CBRS_XT_SEMIFLAT</b> Thin 3D non-flat splitters.[/li]
|
||||
// [li]<b>CBRS_XT_FLAT</b> Flat splitters.[/li]
|
||||
// [/ul]
|
||||
// pFrameWnd - A CFrameWnd pointer to the calling frame window.
|
||||
// Summary: Call this function to enable a control bar to be docked. The sides
|
||||
// specified must match one of the sides enabled for docking in the destination
|
||||
// frame window, or the control bar cannot be docked to that frame window.
|
||||
void EnableDockingExImpl(DWORD dwDockStyle,DWORD dwFlatStyle,CFrameWnd* pFrameWnd);
|
||||
|
||||
// Input: pBar - A CControlBar pointer to the control bar to be docked.
|
||||
// pDockBar - A CDockBar pointer to the dockbar the control bar is docked to.
|
||||
// lpRect - Determines, in screen coordinates, where the control bar will be docked
|
||||
// in the non-client area of the destination frame window.
|
||||
// pFrameWnd - A CFrameWnd pointer to the calling frame window.
|
||||
// Summary: This member function causes a control bar to be docked to the frame
|
||||
// window. The control bar will be docked to one of the sides of the
|
||||
// frame window specified in the calls to both CXTDockWindow::EnableDocking
|
||||
// and CXTFrameWnd::EnableDocking. The side chosen is determined by the
|
||||
// dockbar represented by 'pDockBar'.
|
||||
void DockControlBarImpl(CControlBar* pBar,CDockBar* pDockBar,LPCRECT lpRect,CFrameWnd* pFrameWnd);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: pBar - A CControlBar pointer to the control bar to be docked.
|
||||
// nDockBarID - Determines which sides of the frame window to consider for docking.
|
||||
// It can be 0, or one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_TOP</b> Dock to the top side of the
|
||||
// frame window.[/li]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_BOTTOM</b> Dock to the bottom side of
|
||||
// the frame window.[/li]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_LEFT</b> Dock to the left side of the
|
||||
// frame window.[/li]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_RIGHT</b> Dock to the right side of
|
||||
// the frame window.[/li]
|
||||
// [/ul]
|
||||
// If 0, the control bar can be docked to any side enabled for
|
||||
// docking in the destination frame window.
|
||||
// lpRect - Determines, in screen coordinates, where the control bar will be docked
|
||||
// in the non-client area of the destination frame window.
|
||||
// pFrameWnd - A CFrameWnd pointer to the calling frame window.
|
||||
// Summary: This member function causes a control bar to be docked to the frame
|
||||
// window. The control bar will be docked to one of the sides of the frame
|
||||
// window specified in the calls to both CXTDockWindow::EnableDocking
|
||||
// and CXTFrameWnd::EnableDocking. The side chosen is determined by 'nDockBarID'.
|
||||
void DockControlBarImpl(CControlBar* pBar,UINT nDockBarID,LPCRECT lpRect,CFrameWnd* pFrameWnd);
|
||||
|
||||
// Input: pBar1 - A CControlBar pointer to the control bar to be docked.
|
||||
// pBar2 - A CControlBar pointer to the already docked control bar to be
|
||||
// redocked on the left of 'pBar1'.
|
||||
// pFrameWnd - A CFrameWnd pointer to the calling frame window.
|
||||
// Summary: This member function will redock a control bar specified by 'pBar2'
|
||||
// to the left of a newly docked control bar specified by 'pBar1'.
|
||||
void DockControlBarLeftOfImpl(CControlBar* pBar1,CControlBar* pBar2,CFrameWnd* pFrameWnd);
|
||||
|
||||
// Input: pFrameWnd - A CFrameWnd pointer to the calling frame window.
|
||||
// Returns: A pointer to a CMenu object that represents the active
|
||||
// menu for the frame.
|
||||
// Summary: This member function retrieves a pointer to the menu for the frame
|
||||
// window.
|
||||
CMenu* GetMenuImpl(CFrameWnd* pFrameWnd) const;
|
||||
|
||||
// Input: nCommandID - The command ID of a menu item to hide.
|
||||
// pFrameWnd - A CFrameWnd pointer to the calling frame window.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified command to the list of menu
|
||||
// items to hide until activated by clicking on the chevron.
|
||||
BOOL HideMenuItemImpl(UINT nCommandID,CFrameWnd* pFrameWnd);
|
||||
|
||||
// Input: lpszItem - Text string representing the popup menu item to hide.
|
||||
// pFrameWnd - A CFrameWnd pointer to the calling frame window.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified menu item to the list of
|
||||
// menu items to hide until activated by clicking on the chevron.
|
||||
BOOL HideMenuItemImpl(LPCTSTR lpszItem,CFrameWnd* pFrameWnd);
|
||||
|
||||
// Input: nCommandIDs - An array of command IDs, of menu items, to hide.
|
||||
// nSize - Size of the array passed in.
|
||||
// pFrameWnd - A CFrameWnd pointer to the calling frame window.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified commands to the list of
|
||||
// menu items to hide until activated by clicking on the chevron.
|
||||
BOOL HideMenuItemsImpl(const UINT* nCommandIDs,int nSize,CFrameWnd* pFrameWnd);
|
||||
|
||||
// Input: lpszItems - An array of command IDs, of menu items, to hide.
|
||||
// nSize - Size of the array passed in.
|
||||
// pFrameWnd - A CFrameWnd pointer to the calling frame window.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified menu items to the list of
|
||||
// menu items to hide until activated by clicking on the chevron.
|
||||
BOOL HideMenuItemsImpl(const LPCTSTR lpszItems,int nSize,CFrameWnd* pFrameWnd);
|
||||
|
||||
// Input: pFrameWnd - A CFrameWnd pointer to the calling frame window.
|
||||
// Summary: This member function redraws the menu bar. If a menu bar is changed
|
||||
// after Windows has created the window, call this function to draw the
|
||||
// changed menu bar. Overrides the CWnd implementation.
|
||||
void DrawMenuBarImpl(CFrameWnd* pFrameWnd);
|
||||
|
||||
// Input: pFrameWnd - A CFrameWnd pointer to the calling frame window.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function will initialize the accelerator manager for the
|
||||
// framework.
|
||||
bool InitAccelManagerImpl(CFrameWnd* pFrameWnd);
|
||||
|
||||
// Input: pFrameWnd - A pointer to a CFrameWnd object.
|
||||
// iNormalIndex - Index where the 'Tools' menu should be inserted into the Standard menu.
|
||||
// iWindowIndex - Index where the 'Tools' menu should be inserted into the MDI window menu.
|
||||
// iArgPopupMenu - Resource ID of the popup menu to be displayed for the Arguments
|
||||
// browse edit box.
|
||||
// iDirPopupMenu - Resource ID of the popup menu to be displayed for the Initial
|
||||
// Directory browse edit box.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to initialize the Tools manager for your
|
||||
// application. The Tools manager will insert a "Tools" menu into your
|
||||
// application's menu which allows the user to customize and add custom
|
||||
// commands to the menu. Typically used with toolbar customization,
|
||||
// the Tools manager should be initialized when your frame is loaded by
|
||||
// overriding the virtual function CFrameWnd::LoadFrame and can be managed
|
||||
// by selecting the 'Tools' tab in the Customize dialog.
|
||||
bool InitToolsManagerImpl(CFrameWnd* pFrameWnd,int iNormalIndex,int iWindowIndex,int iArgPopupMenu,int iDirPopupMenu);
|
||||
|
||||
// Input: pFrameWnd - A pointer to a CFrameWnd object.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to initialize the Options manager for your
|
||||
// application. Typically used with toolbar customization, the Options
|
||||
// manager will allow the user to configure options related to the toolbar
|
||||
// and menu behavior for the application. The options manager should
|
||||
// be initialized when your frame is loaded by overriding the virtual
|
||||
// function CFrameWnd::LoadFrame and can be managed by selecting the 'Options'
|
||||
// tab in the Customize dialog.
|
||||
bool InitOptionsManagerImpl(CFrameWnd* pFrameWnd);
|
||||
|
||||
// Input: lpszText - String to append to the browse edit string.
|
||||
// iWhich - Enumerated value that specifies which browse edit to update.
|
||||
// It can be either XT_TOOLARG or XT_TOOLDIR.
|
||||
// bAppend - true to append the string, false to replace the string.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function is called to update the Tools manager argument
|
||||
// or directory string by appending the string displayed in the corresponding
|
||||
// edit field. This function is used by the framework whenever the argument
|
||||
// or directory browse edit in the Tools manager tab of the toolbar Customize
|
||||
// dialog is configured to use a popup menu.
|
||||
bool UpdateToolsItem(LPCTSTR lpszText,int iWhich,bool bAppend);
|
||||
|
||||
void SetDockStateImpl(const CXTDockState& state, CFrameWnd* pFrameWnd);
|
||||
void GetDockStateImpl(CXTDockState& state, CFrameWnd* pFrameWnd) const;
|
||||
BOOL PreCreateWindowImpl(CREATESTRUCT& cs, UINT uIcon, CFrameWnd* pFrameWnd);
|
||||
BOOL PreTranslateMessageImpl(MSG* pMsg, CFrameWnd* pFrameWnd);
|
||||
void OnSysColorChangeImpl(CFrameWnd* pFrameWnd);
|
||||
void OnSettingChangeImpl(UINT uFlags, LPCTSTR lpszSection, CFrameWnd* pFrameWnd);
|
||||
void OnCustomizeBarImpl(CFrameWnd* pFrameWnd);
|
||||
void OnInitMenuPopupImpl(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
|
||||
BOOL OnToolsManagerImpl(UINT nID);
|
||||
void OnUpdateToolsManagerImpl(CCmdUI* pCmdUI);
|
||||
void OnUpdateChevronImpl(CCmdUI* pCmdUI);
|
||||
|
||||
friend class CXTToolBar;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTFRAMEIMPL_H__)
|
||||
299
Editor/XT/Include/XTFrameWnd.h
Normal file
299
Editor/XT/Include/XTFrameWnd.h
Normal file
@@ -0,0 +1,299 @@
|
||||
// XTFrameWnd.h interface for the CXTFrameWnd class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTFRAMEWND_H__)
|
||||
#define __XTFRAMEWND_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTFrameWnd is a multiple inheritance class derived from CFrameWnd and
|
||||
// CXTFrameImpl. CXTFrameWnd extends the standard CFrameWnd class to allow
|
||||
// CXTDockWindow and CXTToolBar docking, customization, and cool menu support.
|
||||
class _XT_EXT_CLASS CXTFrameWnd : public CFrameWnd, public CXTFrameImpl
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTFrameWnd)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTFrameWnd object.
|
||||
CXTFrameWnd();
|
||||
|
||||
// Summary: Destroys a CXTFrameWnd object, handles cleanup and de-allocation.
|
||||
virtual ~CXTFrameWnd();
|
||||
|
||||
protected:
|
||||
|
||||
public:
|
||||
|
||||
// Input: pViewClass - A pointer to a CRuntimeClass structure associated with your view.
|
||||
// pDocument - A pointer to the document to be used with the view. If NULL
|
||||
// the same document will be used for all SDI views.
|
||||
// pContext - Specifies the type of view and document, if NULL this will be
|
||||
// created for you.
|
||||
// Summary: Call this member function to switch views for your SDI application.
|
||||
virtual void SwitchSDIView(CRuntimeClass *pViewClass,CDocument *pDocument=NULL,CCreateContext *pContext=NULL);
|
||||
|
||||
// Returns: A CXTCoolMenu pointer that represents the cool menu object associated with
|
||||
// the frame.
|
||||
// Summary: Call this member function to retrieve a pointer to the cool menu
|
||||
// object associated with the frame.
|
||||
CXTCoolMenu* GetCoolMenu();
|
||||
|
||||
// Returns: A CXTMenuBar pointer that represents the menu bar associated with the frame.
|
||||
// Summary: Call this member function to retrieve a pointer to the menu bar associated
|
||||
// with the frame.
|
||||
CXTMenuBar* GetMenuBar();
|
||||
|
||||
// Input: nIDToolBars - Array of toolbar resource IDs. The cool menu will use the toolbar
|
||||
// commands to map the icons placed next to the corresponding menu commands.
|
||||
// nSize - Size of the array of toolbars.
|
||||
// Summary: Call this member function to install cool menus for your application.
|
||||
// Cool menus are menus that appear with icons next to the menu titles.
|
||||
// Pass in your toolbar resource array to initialize.
|
||||
void InstallCoolMenus(const UINT* nIDToolBars,int nSize);
|
||||
|
||||
// Input: nIDToolBar - Toolbar resource ID. The cool menu will use the toolbar commands
|
||||
// to map the icons placed next to the corresponding menu commands.
|
||||
// Summary: Call this member function to install cool menus for your application.
|
||||
// Cool menus are menus that appear with icons next to the menu titles.
|
||||
// Pass in your toolbar resource to initialize.
|
||||
void InstallCoolMenus(const UINT nIDToolBar);
|
||||
|
||||
// Input: lpszProfileName - Name of a section in the initialization file or a key in the
|
||||
// Windows registry where state information is stored.
|
||||
// Summary: This member function is called by the frame window to restore the
|
||||
// settings of the control bar.
|
||||
virtual void LoadBarState(LPCTSTR lpszProfileName);
|
||||
|
||||
// Input: lpszProfileName - Name of a section in the initialization file or a key in the
|
||||
// Windows registry where state information is stored.
|
||||
// Summary: This member function is called by the frame window to save the settings
|
||||
// of the control bar.
|
||||
virtual void SaveBarState(LPCTSTR lpszProfileName) const;
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwDockStyle - Specifies whether the control bar supports docking and the sides
|
||||
// of its parent window to which the control bar can be docked, if supported.
|
||||
// The style can be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_ALIGN_TOP</b> Allows docking at the top of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_BOTTOM</b> Allows docking at the bottom of
|
||||
// the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_LEFT</b> Allows docking on the left side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_RIGHT</b> Allows docking on the right side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_ANY</b> Allows docking on any side of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_FLOAT_MULTI</b> Allows multiple control bars to
|
||||
// be floated in a single mini-frame window.[/li]
|
||||
// [/ul]
|
||||
// If 0 (that is, indicating no flags), the control bar will not dock.
|
||||
// Summary: Call this function to enable a control bar to be docked. The sides
|
||||
// specified must match one of the sides enabled for docking in the destination
|
||||
// frame window, or the control bar cannot be docked to that frame window.
|
||||
void EnableDocking(DWORD dwDockStyle);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwDockStyle - Specifies whether the control bar supports docking and the sides
|
||||
// of its parent window to which the control bar can be docked, if supported.
|
||||
// The style can be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_ALIGN_TOP</b> Allows docking at the top of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_BOTTOM</b> Allows docking at the bottom of
|
||||
// the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_LEFT</b> Allows docking on the left side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_RIGHT</b> Allows docking on the right side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_ANY</b> Allows docking on any side of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_FLOAT_MULTI</b> Allows multiple control bars to
|
||||
// be floated in a single mini-frame window.[/li]
|
||||
// [/ul]
|
||||
// If 0 (that is, indicating no flags), the control bar will not
|
||||
// dock.
|
||||
// dwFlatStyle - Specifies the splitter's, inside dockbars, look. It can be one
|
||||
// of the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_XT_NONFLAT</b> Thick devstudio like non-flat splitters.[/li]
|
||||
// [li]<b>CBRS_XT_SEMIFLAT</b> Thin 3D non-flat splitters.[/li]
|
||||
// [li]<b>CBRS_XT_FLAT</b> Flat splitters.[/li]
|
||||
// [/ul]
|
||||
// Summary: Call this function to enable a control bar to be docked. The sides
|
||||
// specified must match one of the sides enabled for docking in the destination
|
||||
// frame window, or the control bar cannot be docked to that frame window.
|
||||
void EnableDockingEx(DWORD dwDockStyle,DWORD dwFlatStyle);
|
||||
|
||||
// Input: pBar - A CControlBar pointer to the control bar to be docked.
|
||||
// pDockBar - A CDockBar pointer to the dockbar the control bar is docked to.
|
||||
// lpRect - Determines, in screen coordinates, where the control bar will
|
||||
// be docked in the non-client area of the destination frame window.
|
||||
// Summary: This member function causes a control bar to be docked to the frame
|
||||
// window. The control bar will be docked to one of the sides of the frame
|
||||
// window specified in the calls to both CXTDockWindow::EnableDocking
|
||||
// and CXTFrameWnd::EnableDocking. The side chosen is determined by the
|
||||
// dockbar represented by 'pDockBar'.
|
||||
void DockControlBar(CControlBar* pBar,CDockBar* pDockBar,LPCRECT lpRect = NULL);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: pBar - A CControlBar pointer to the control bar to be docked.
|
||||
// nDockBarID - Determines which sides of the frame window to consider for docking.
|
||||
// It can be 0, or one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_TOP</b> to the top side of the frame
|
||||
// window.[/li]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_BOTTOM</b> Dock to the bottom side of
|
||||
// the frame window.[/li]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_LEFT</b> Dock to the left side of the
|
||||
// frame window.[/li]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_RIGHT</b> Dock to the right side of
|
||||
// the frame window.[/li]
|
||||
// [/ul]
|
||||
// If 0, the control bar can be docked to any side enabled for
|
||||
// docking in the destination frame window.
|
||||
// lpRect - Determines, in screen coordinates, where the control bar will
|
||||
// be docked in the non-client area of the destination frame window.
|
||||
// Summary: This member function causes a control bar to be docked to the frame
|
||||
// window. The control bar will be docked to one of the sides of the
|
||||
// frame window specified in the calls to both CXTDockWindow::EnableDocking
|
||||
// and CXTFrameWnd::EnableDocking. The side chosen is determined by nDockBarID.
|
||||
void DockControlBar(CControlBar* pBar,UINT nDockBarID = 0,LPCRECT lpRect = NULL);
|
||||
|
||||
// Input: pBar1 - A CControlBar pointer to the control bar to be docked.
|
||||
// pBar2 - A CControlBar pointer to the already docked control bar to be
|
||||
// redocked on the left of 'pBar1'.
|
||||
// Summary: This member function will redock a control bar specified by 'pBar2'
|
||||
// to the left of a newly docked control bar specified by 'pBar1'.
|
||||
virtual void DockControlBarLeftOf(CControlBar* pBar1,CControlBar* pBar2);
|
||||
|
||||
// Returns: A pointer to a CMenu object that represents the active menu for the frame.
|
||||
// Summary: This member function retrieves a pointer to the menu for the frame
|
||||
// window.
|
||||
virtual CMenu* GetMenu() const;
|
||||
|
||||
// Input: nCommandID - The command ID of a menu item to hide.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified command to the list of menu
|
||||
// items to hide until activated by clicking on the chevron.
|
||||
virtual BOOL HideMenuItem(UINT nCommandID);
|
||||
|
||||
// Input: lpszItem - Text string representing the popup menu item to hide.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified menu item to the list of
|
||||
// menu items to hide until activated by clicking on the chevron.
|
||||
virtual BOOL HideMenuItem(LPCTSTR lpszItem);
|
||||
|
||||
// Input: nCommandIDs - An array of command IDs, of menu items, to hide.
|
||||
// nSize - Size of the array passed in.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified commands to the list of
|
||||
// menu items to hide until activated by clicking on the chevron.
|
||||
virtual BOOL HideMenuItems(const UINT* nCommandIDs,int nSize);
|
||||
|
||||
// Input: lpszItems - An array of command IDs, of menu items, to hide.
|
||||
// nSize - Size of the array passed in.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified menu items to the list of
|
||||
// menu items to hide until activated by clicking on the chevron.
|
||||
virtual BOOL HideMenuItems(const LPCTSTR lpszItems,int nSize);
|
||||
|
||||
// Summary: This member function redraws the menu bar. If a menu bar is changed
|
||||
// after Windows has created the window, call this function to draw the
|
||||
// changed menu bar. Overrides the CWnd implementation.
|
||||
void DrawMenuBarX();
|
||||
|
||||
// Summary: Call this function to display the Customize Toolbar dialog box.
|
||||
// This dialog box allows the user to customize the toolbar by adding
|
||||
// and deleting buttons.
|
||||
void Customize();
|
||||
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function will initialize the accelerator manager for the
|
||||
// framework.
|
||||
bool InitAccelManager();
|
||||
|
||||
// Input: iNormalIndex - Index where the 'Tools' menu should be inserted into the standard menu.
|
||||
// iWindowIndex - Index where the 'Tools' menu should be inserted into the MDI window menu.
|
||||
// iArgPopupMenu - Resource ID of the popup menu to be displayed for the Arguments
|
||||
// browse edit box.
|
||||
// iDirPopupMenu - Resource ID of the popup menu to be displayed for the Initial
|
||||
// Directory browse edit box.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to initialize the Tools manager for your
|
||||
// application. The tools manager will insert a "Tools" menu into your
|
||||
// application's menu which allows the user to customize and add custom
|
||||
// commands to the menu. Typically used with toolbar customization, the
|
||||
// Tools manager should be initialized when your frame is loaded by overriding
|
||||
// the virtual function CFrameWnd::LoadFrame and can be managed by selecting
|
||||
// the 'Tools' tab in the customize dialog.
|
||||
bool InitToolsManager(int iNormalIndex,int iWindowIndex=-1,int iArgPopupMenu=0,int iDirPopupMenu=0);
|
||||
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to initialize the Options manager for your
|
||||
// application. Typically used with toolbar customization, the Options
|
||||
// manager will allow the user to configure options related to the toolbar
|
||||
// and menu behavior for the application. The Options manager should
|
||||
// be initialized when your frame is loaded by overriding the virtual
|
||||
// function CFrameWnd::LoadFrame and can be managed by selecting the 'Options'
|
||||
// tab in the Customize dialog.
|
||||
bool InitOptionsManager();
|
||||
|
||||
protected:
|
||||
|
||||
virtual void SetDockState(const CXTDockState& state);
|
||||
virtual void GetDockState(CXTDockState& state) const;
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTFrameWnd)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs, UINT uIcon);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTFrameWnd)
|
||||
afx_msg void OnSysColorChange();
|
||||
afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
|
||||
afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg void OnCustomizeBar();
|
||||
afx_msg BOOL OnToolsManager(UINT nID);
|
||||
afx_msg void OnUpdateToolsManager(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateChevron(CCmdUI* pCmdUI);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTFrameWnd::Customize() {
|
||||
OnCustomizeBar();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTFRAMEWND_H__)
|
||||
336
Editor/XT/Include/XTFunctions.h
Normal file
336
Editor/XT/Include/XTFunctions.h
Normal file
@@ -0,0 +1,336 @@
|
||||
// XTFunctions.h interface for the XT_AUX_DATA struct.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTFUNCTIONS_H__)
|
||||
#define __XTFUNCTIONS_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//:Associate with "Global Functions"
|
||||
|
||||
#if defined(XT_INIT_BY_REGULAR_DLL)
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: This member function will initialize the resources for the Xtreme Toolkit.
|
||||
// If using the Xtreme Toolkit as an extension DLL within a regular DLL,
|
||||
// add the following two lines to your stdafx.h file. This will give you
|
||||
// access to the exported function InitXtremeExtDll():
|
||||
//
|
||||
// <pre>#define XT_INIT_BY_REGULAR_DLL
|
||||
// #include "XTToolkit.h"</pre>
|
||||
//
|
||||
// You will then need to add XT_INIT_BY_REGULAR_DLL to the Xtreme Toolkit
|
||||
// preprocessor definitions and rebuild it. After you have done this
|
||||
// locate your CWinApp::InitInstance() method for your regular DLL and make
|
||||
// the following call:
|
||||
//
|
||||
// <pre>InitXtremeExtDLL();</pre>
|
||||
//
|
||||
// This will initialize the resources for the Xtreme Toolkit.
|
||||
extern _XT_EXT_CLASS void WINAPI InitXtremeExtDLL();
|
||||
#endif // defined(XT_INIT_BY_REGULAR_DLL)
|
||||
|
||||
// Input: pWnd - Pointer to a valid CWnd object.
|
||||
// pFont - Pointer to the new font to set for the window.
|
||||
// Summary: This member function will set the font for the window specified by
|
||||
// 'pWnd' and all of the child windows owned by 'pWnd'.
|
||||
extern _XT_EXT_CLASS void AFXAPI _xtAfxChangeWindowFont(CWnd* pWnd,CFont* pFont);
|
||||
|
||||
// Input: pDC - Pointer to the current device context.
|
||||
// imageList - Address of an image list.
|
||||
// nIndex - Index of the image in the image list.
|
||||
// point - XY location of where to draw the icon.
|
||||
// bInColor - TRUE to draw the item in color, otherwise the
|
||||
// icon will be drawn with the default disabled look.
|
||||
// Summary: This member function will draw an embossed icon from the image
|
||||
// list that is passed in, into the specified device context. Typically
|
||||
// used by toolbars and menus to draw a disabled icon in color.
|
||||
extern _XT_EXT_CLASS void AFXAPI _xtAfxDrawEmbossed(CDC* pDC,CImageList& imageList,int nIndex,CPoint point,BOOL bInColor);
|
||||
|
||||
// Input: hInst - Instance handle of the module that has the required resource.
|
||||
// hRsrc - Bitmap resource handle.
|
||||
// bMono - Tells if monochrome conversion shall be applied.
|
||||
// Summary: This member function loads a bitmap from resource and translates the
|
||||
// bitmap color such that they suit requirements for a toolbar bitmap.
|
||||
extern _XT_EXT_CLASS HBITMAP AFXAPI _xtAfxLoadSysColorBitmap(HINSTANCE hInst,HRSRC hRsrc,BOOL bMono = FALSE);
|
||||
|
||||
// Input: pDC - Points to the current device context.
|
||||
// rect - Size of the area to draw.
|
||||
// Summary: This member function will draw a shadow rect into the specified
|
||||
// device context.
|
||||
extern _XT_EXT_CLASS void AFXAPI _xtAfxDrawShadedRect(CDC *pDC,CRect& rect);
|
||||
|
||||
// Input: hWnd - HWND handle of the parent window to find the child for.
|
||||
// pt - Current cursor position.
|
||||
// Returns: An HWND handle for the child window at 'pt'.
|
||||
// Summary: This member function will retrieve an HWND handle for the child window
|
||||
// found directly under the cursor position specified by 'pt'.
|
||||
extern _XT_EXT_CLASS HWND AFXAPI _xtAfxChildWindowFromPoint(HWND hWnd,POINT pt);
|
||||
|
||||
// Input: strText - A reference to a CString object.
|
||||
// Summary: This member function will search a string, strip off the mnemonic
|
||||
// '&', and reformat the string.
|
||||
extern _XT_EXT_CLASS void AFXAPI _xtAfxStripMnemonics(CString& strText);
|
||||
|
||||
// Input: lpszFileName - Fully qualified path for the item to find.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will test for the existence of a file or folder.
|
||||
extern _XT_EXT_CLASS BOOL AFXAPI _xtAfxExist(LPCTSTR lpszFileName);
|
||||
|
||||
// Input: pszPath - Pointer to a NULL-terminated string with the path. Paths are delimited
|
||||
// by backslashes or by the NULL at the end of the path.
|
||||
// Returns: A pointer to a NULL-terminated string with the next path component
|
||||
// if successful, or NULL otherwise.
|
||||
// Summary: This member function parses a path for the next path component, not
|
||||
// dependent on shell32.dll, and is a replacement for the windows API
|
||||
// PathFindNextComponent.
|
||||
extern _XT_EXT_CLASS LPTSTR AFXAPI _xtAfxPathFindNextComponent(LPCTSTR pszPath);
|
||||
|
||||
// Input: pParentWnd - Points to the parent of the view to be created. The parent must be
|
||||
// valid.
|
||||
// pViewClass - CView runtime class.
|
||||
// pDocument - CDocument associated with the view. It can be NULL.
|
||||
// pContext - Create context for the view. It can be NULL.
|
||||
// dwStyle - Default style for the view.
|
||||
// pOwnerWnd - Owner of the view. If NULL, 'pParentWnd' is used.
|
||||
// nID - Control ID of the view.
|
||||
// Returns: A CWnd* pointer to the newly created view if successful,
|
||||
// otherwise returns NULL.
|
||||
// Summary: This member function dynamically creates a view based on a CRuntimeClass
|
||||
// object.
|
||||
extern _XT_EXT_CLASS CWnd* AFXAPI _xtAfxCreateView(CWnd* pParentWnd,CRuntimeClass *pViewClass, CDocument *pDocument=NULL,CCreateContext *pContext=NULL,DWORD dwStyle=AFX_WS_DEFAULT_VIEW,CWnd* pOwnerWnd=NULL,UINT nID=AFX_IDW_PANE_FIRST);
|
||||
|
||||
// Input: lparam1 - Corresponds to the lParam member of the TV_ITEM structure for the
|
||||
// two items being compared.
|
||||
// lparam2 - Corresponds to the lParam member of the TV_ITEM structure for the
|
||||
// two items being compared.
|
||||
// lparamSort - The 'lParamSort' member corresponds to the lParam member of TV_SORTCB.
|
||||
// Returns: A negative value if the first item should precede the second,
|
||||
// a positive value if the first item should follow the second, or zero
|
||||
// if the two items are equivalent.
|
||||
// Summary: This member function is a callback function used by CXTShellTreeCtrl
|
||||
// and CXTShellTreeView, and is called during a sort operation each
|
||||
// time the relative order of two list items needs to be compared.
|
||||
extern _XT_EXT_CLASS int CALLBACK _xtAfxTreeViewCompareProc(LPARAM lparam1,LPARAM lparam2,LPARAM lparamSort);
|
||||
|
||||
// Input: lparam1 - Corresponds to the lParam member of the LV_ITEM structure for the
|
||||
// two items being compared.
|
||||
// lparam2 - Corresponds to the lParam member of the LV_ITEM structure for the
|
||||
// two items being compared.
|
||||
// lparamSort - The 'lParamSort' member corresponds to the lParam member of LV_SORTCB.
|
||||
// Returns: A negative value if the first item should precede the second,
|
||||
// a positive value if the first item should follow the second, or zero
|
||||
// if the two items are equivalent.
|
||||
// Summary: This member function is a callback function used by CXTShellListCtrl
|
||||
// and CXTShellListView, and is called during a sort operation each time
|
||||
// the relative order of two list items needs to be compared.
|
||||
extern _XT_EXT_CLASS int CALLBACK _xtAfxListViewCompareProc(LPARAM lparam1,LPARAM lparam2,LPARAM lparamSort);
|
||||
|
||||
// Input: pView - Pointer to the view to dispaly print preview for.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this global function to display an office style print preview window
|
||||
// for your CView derived class.
|
||||
_XT_EXT_CLASS bool _xtAfxShowPrintPreview(CView* pView);
|
||||
|
||||
extern _XT_EXT_CLASS void AFXAPI _xtAfxMakeOleVariant(COleVariant &ov, LPCITEMIDLIST pidl);
|
||||
#ifdef _DEBUG
|
||||
extern _XT_EXT_CLASS void AFXAPI _xtAfxAssertValidBarIDs(CFrameWnd* pFrameWnd);
|
||||
#endif //_DEBUG
|
||||
|
||||
//:Associate with "Dialog Data Exchange"
|
||||
|
||||
// Input: pDX - A pointer to a CDataExchange object. The framework supplies this
|
||||
// object to establish the context of the data exchange, including its
|
||||
// direction.
|
||||
// nIDC - The resource ID of the color picker control associated with the
|
||||
// control property.
|
||||
// value - A reference to a member variable of the dialog box, form view, or
|
||||
// control view object with which data is exchanged.
|
||||
// Summary: CXTColorPicker - The DDX_XTColorPicker function manages the transfer
|
||||
// of integer data between a color picker control in a dialog box, form view,
|
||||
// or control view object and a COLORREF data member of the dialog box,
|
||||
// form view, or control view object.
|
||||
//
|
||||
// When DDX_XTColorPicker is called, 'value' is set to the current state
|
||||
// of the color picker control.
|
||||
extern _XT_EXT_CLASS void AFXAPI DDX_XTColorPicker(CDataExchange* pDX,int nIDC,COLORREF& value);
|
||||
|
||||
//:Associate with "Dialog Data Exchange"
|
||||
|
||||
// Input: pDX - A pointer to a CDataExchange object. The framework supplies this
|
||||
// object to establish the context of the data exchange, including its
|
||||
// direction. You do not need to delete this object.
|
||||
// nIDC - The resource ID of the date and time picker control associated with
|
||||
// the member variable.
|
||||
// value - A reference to a COleDateTime member variable, dialog box, form
|
||||
// view, or control view object with which data is exchanged.
|
||||
// Summary: CXTDateTimeCtrl - The DDX_XTDateTimeCtrl function manages the transfer
|
||||
// of date and/or time data between a date and time picker control (CXTDateTimeCtrl)
|
||||
// in a dialog box or form view object and a COleDateTime data member of the
|
||||
// dialog box or form view object.
|
||||
//
|
||||
// When CXTDateTimeCtrl is called, 'value' is set to the current state
|
||||
// of the date and time picker control, or the control is set to 'value',
|
||||
// depending on the direction of the exchange.
|
||||
extern _XT_EXT_CLASS void AFXAPI DDX_XTDateTimeCtrl(CDataExchange* pDX,int nIDC,COleDateTime& value);
|
||||
|
||||
//:Associate with "Dialog Data Exchange"
|
||||
|
||||
// Input: pDX - A pointer to a CDataExchange object. The framework supplies this
|
||||
// object to establish the context of the data exchange, including its
|
||||
// direction. You do not need to delete this object.
|
||||
// nIDC - The resource ID of the date and time picker control associated with
|
||||
// the member variable.
|
||||
// value - A reference to a CTime member variable, dialog box, form view, or
|
||||
// control view object with which data is exchanged.
|
||||
// Summary: CXTDateTimeCtrl - The DDX_XTDateTimeCtrl function manages the transfer
|
||||
// of date and/or time data between a date and time picker control (CXTDateTimeCtrl)
|
||||
// in a dialog box or form view object, and a CTime data member of the dialog
|
||||
// box or form view object.
|
||||
//
|
||||
// When CXTDateTimeCtrl is called, 'value' is set to the current state
|
||||
// of the date and time picker control, or the control is set to 'value',
|
||||
// depending on the direction of the exchange.
|
||||
extern _XT_EXT_CLASS void AFXAPI DDX_XTDateTimeCtrl(CDataExchange* pDX,int nIDC,CTime& value);
|
||||
|
||||
//:Associate with "Dialog Data Validation"
|
||||
|
||||
// Input: pDX - A pointer to a CDataExchange object. The framework supplies this
|
||||
// object to establish the context of the data exchange, including its
|
||||
// direction. You do not need to delete this object.
|
||||
// refValue - A reference to a CTime object associated with a member variable
|
||||
// of the dialog box, form view, or control view object. This object contains
|
||||
// the data to be validated.
|
||||
// pMinRange - Minimum date/time value allowed.
|
||||
// pMaxRange - Maximum date/time value allowed.
|
||||
// Summary: CXTDateTimeCtrl - Call DDV_XTMinMaxDateTime to verify that the time/date
|
||||
// value in the date and time picker control (CXTDateTimeCtrl) associated
|
||||
// with 'refValue' falls between 'pMinRange' and 'pMaxRange'.
|
||||
extern _XT_EXT_CLASS void AFXAPI DDV_XTMinMaxDateTime(CDataExchange* pDX,CTime& refValue,const CTime* pMinRange,const CTime* pMaxRange);
|
||||
|
||||
//:Associate with "Dialog Data Validation"
|
||||
|
||||
// Input: pDX - A pointer to a CDataExchange object. The framework supplies this
|
||||
// object to establish the context of the data exchange, including its
|
||||
// direction. You do not need to delete this object.
|
||||
// refValue - A reference to a COleDateTime object associated with a member variable
|
||||
// of the dialog box, form view, or control view object. This object
|
||||
// contains the data to be validated.
|
||||
// pMinRange - Minimum date/time value allowed.
|
||||
// pMaxRange - Maximum date/time value allowed.
|
||||
// Summary: CXTDateTimeCtrl - Call DDV_XTMinMaxDateTime to verify that the time/date
|
||||
// value in the date and time picker control (CXTDateTimeCtrl) associated
|
||||
// with 'refValue' falls between 'pMinRange' and 'pMaxRange'.
|
||||
extern _XT_EXT_CLASS void AFXAPI DDV_XTMinMaxDateTime(CDataExchange* pDX,COleDateTime& refValue,const COleDateTime* pMinRange,const COleDateTime* pMaxRange);
|
||||
|
||||
//:Associate with "Dialog Data Exchange"
|
||||
|
||||
// Input: pDX - A pointer to a CDataExchange object. The framework supplies this
|
||||
// object to establish the context of the data exchange, including its
|
||||
// direction. You do not need to delete this object.
|
||||
// nIDC - The resource ID of the month calendar control associated with the
|
||||
// member variable.
|
||||
// value - A reference to a COleDateTime member variable of the dialog box,
|
||||
// form view, or control view object with which data is exchanged.
|
||||
// Summary: CXTMonthCalCtrl - The DDX_XTMonthCalCtrl function manages the transfer
|
||||
// of date data between a month calendar control (DDX_XTMonthCalCtrl),
|
||||
// in a dialog box, form view, or control view object, and a COleDateTime
|
||||
// data member, of the dialog box, form view, or control view object.
|
||||
//
|
||||
// Remarks: The control manages a date value only. The time fields in the
|
||||
// time object are set to reflect the creation time of the control window,
|
||||
// or whatever time was set in the control with a call to CXTMonthCalCtrl::SetCurSel.
|
||||
//
|
||||
// When DDX_XTMonthCalCtrl is called, 'value' is set to the current state of
|
||||
// the month calendar control.
|
||||
extern _XT_EXT_CLASS void AFXAPI DDX_XTMonthCalCtrl(CDataExchange* pDX, int nIDC,COleDateTime& value);
|
||||
|
||||
//:Associate with "Dialog Data Exchange"
|
||||
|
||||
// Input: pDX - A pointer to a CDataExchange object. The framework supplies this
|
||||
// object to establish the context of the data exchange, including its
|
||||
// direction. You do not need to delete this object.
|
||||
// nIDC - The resource ID of the month calendar control associated with the
|
||||
// member variable.
|
||||
// value - A reference to a CTime member variable of the dialog box, form view,
|
||||
// or control view object with which data is exchanged.
|
||||
// Remarks: The control manages a date value only. The time fields in the
|
||||
// time object are set to reflect the creation time of the control window,
|
||||
// or whatever time was set in the control with a call to CXTMonthCalCtrl::SetCurSel.
|
||||
//
|
||||
// When DDX_XTMonthCalCtrl is called, 'value' is set to the current state of
|
||||
// the month calendar control.
|
||||
// Summary: CXTMonthCalCtrl - The DDX_XTMonthCalCtrl function manages the transfer
|
||||
// of date data between a month calendar control (DDX_XTMonthCalCtrl), in
|
||||
// a dialog box, form view, or control view object, and a CTime data
|
||||
// member of the dialog box, form view, or control view object.
|
||||
extern _XT_EXT_CLASS void AFXAPI DDX_XTMonthCalCtrl(CDataExchange* pDX,int nIDC,CTime& value);
|
||||
|
||||
//:Associate with "Dialog Data Validation"
|
||||
|
||||
// Input: pDX - A pointer to a CDataExchange object. The framework supplies this
|
||||
// object to establish the context of the data exchange, including its
|
||||
// direction.
|
||||
// refValue - A reference to an object of type CTime associated with a member
|
||||
// variable of the dialog box, form view, or control view object. This
|
||||
// object contains the data to be validated. MFC passes this reference
|
||||
// when DDV_XTMinMaxMonth is called.
|
||||
// pMinRange - Minimum date/time value allowed.
|
||||
// pMaxRange - Maximum date/time value allowed.
|
||||
// Summary: CXTMonthCalCtrl - Call DDV_XTMinMaxMonth to verify that the time/date
|
||||
// value in the month calendar control (CXTMonthCalCtrl) associated with
|
||||
// 'refValue' falls between 'pMinRange' and 'pMaxRange'.
|
||||
extern _XT_EXT_CLASS void AFXAPI DDV_XTMinMaxMonth(CDataExchange* pDX,CTime& refValue,const CTime* pMinRange,const CTime* pMaxRange);
|
||||
|
||||
//:Associate with "Dialog Data Validation"
|
||||
|
||||
// Input: pDX - A pointer to a CDataExchange object. The framework supplies this
|
||||
// object to establish the context of the data exchange, including its
|
||||
// direction.
|
||||
// refValue - A reference to an object of type CTime associated with a member
|
||||
// variable of the dialog box, form view, or control view object. This
|
||||
// object contains the data to be validated. MFC passes this reference
|
||||
// when DDV_XTMinMaxMonth is called.
|
||||
// pMinRange - Minimum date/time value allowed.
|
||||
// pMaxRange - Maximum date/time value allowed.
|
||||
// Summary: CXTMonthCalCtrl - Call DDV_XTMinMaxMonth to verify that the time/date
|
||||
// value in the month calendar control (CXTMonthCalCtrl) associated with
|
||||
// 'refValue' falls between 'pMinRange' and 'pMaxRange'.
|
||||
extern _XT_EXT_CLASS void AFXAPI DDV_XTMinMaxMonth(CDataExchange* pDX,COleDateTime& refValue,const COleDateTime* pMinRange,const COleDateTime* pMaxRange);
|
||||
|
||||
class CXTDateEdit;
|
||||
|
||||
//:Associate with "Dialog Data Exchange"
|
||||
|
||||
// Input: pDX - A pointer to a CDataExchange object. The framework supplies this
|
||||
// object to establish the context of the data exchange, including its
|
||||
// direction.
|
||||
// nIDC - The resource ID of the date edit control associated with the control
|
||||
// property.
|
||||
// rControl - A reference to a member variable of the dialog box, form view, or
|
||||
// control view object with which data is exchanged.
|
||||
// rDateTime - A reference to a member variable of the dialog box, form view, or
|
||||
// control view object with which data is exchanged.
|
||||
// Summary: CXTDateEdit - The DDX_XTOleDateTime function manages the transfer of
|
||||
// integer data between a date edit control, in a dialog box, form view, or
|
||||
// control view object, and a COleDateTime data member of the dialog box,
|
||||
// form view, or control view object.
|
||||
//
|
||||
// When DDX_XTOleDateTime is called, 'value' is set to the current state
|
||||
// of the date edit control.
|
||||
extern _XT_EXT_CLASS void AFXAPI DDX_XTOleDateTime(CDataExchange* pDX,int nIDC,CXTDateEdit& rControl,COleDateTime& rDateTime);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // #if !defined(__XTFUNCTIONS_H__)
|
||||
750
Editor/XT/Include/XTGlobal.h
Normal file
750
Editor/XT/Include/XTGlobal.h
Normal file
@@ -0,0 +1,750 @@
|
||||
// XTGlobal.h interface for the XT_AUX_DATA struct.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTGLOBALS_H__)
|
||||
#define __XTGLOBALS_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Uncomment this definition if your application uses a resource dll,
|
||||
// and add #include "XTResource.rc" to your resource dll's .rc2 file.
|
||||
// You will have to call xtAfxData.InitResources(HINSTANCE) once you
|
||||
// have a resource handle, to initialize the Xtreme Toolkit resources.
|
||||
// You will need to rebuild the library after you have done this.
|
||||
//#define _XT_USES_RESOURCE_DLL
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_ASSERT_MSG is similar to ASSERT, except that it allows a custom
|
||||
// message to be specified.
|
||||
#ifdef _DEBUG
|
||||
|
||||
#ifndef _AFX_NO_DEBUG_CRT
|
||||
|
||||
#define XT_ASSERT_MSG(exp, msg) \
|
||||
{ \
|
||||
if ( !(exp) && (_CrtDbgReport( _CRT_ASSERT, __FILE__, __LINE__, NULL, "\n-----------------------\n" msg "\n-----------------------" ) ) ) \
|
||||
AfxDebugBreak(); \
|
||||
} \
|
||||
|
||||
#else
|
||||
#define XT_ASSERT_MSG(exp, msg) (void)( (exp) || (_assert("\n-----------------------\n" msg "\n-----------------------", __FILE__, __LINE__), 0) )
|
||||
#endif//_AFX_NO_DEBUG_CRT
|
||||
|
||||
#else
|
||||
#define XT_ASSERT_MSG(exp, msg) ((void)0)
|
||||
#endif//_DEBUG
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_DROPDOWNBUTTON is a stand alone helper structure class. It is used
|
||||
// by the CXTToolBar class to handle popup menu and color picker.
|
||||
struct XT_DROPDOWNBUTTON
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a XT_DROPDOWNBUTTON object with default values.
|
||||
XT_DROPDOWNBUTTON();
|
||||
|
||||
// Input: pOther - A pointer to a valid XT_DROPDOWNBUTTON structure.
|
||||
// Summary: Constructs a XT_DROPDOWNBUTTON object by copying values from an existing
|
||||
// XT_DROPDOWNBUTTON structure.
|
||||
XT_DROPDOWNBUTTON(const XT_DROPDOWNBUTTON* pOther);
|
||||
|
||||
UINT idButton; // Command ID of the button.
|
||||
UINT idMenu; // Popup menu to display.
|
||||
BOOL bShowColor; // TRUE to draw a color box for color selection.
|
||||
BOOL bMenuBarPopup; // It is mutually exclusive with 'bShowColor'. TRUE if a toolbar dropdown was created from a menu bar popup.
|
||||
BOOL bColorPicker; // TRUE if the dropdown is a color picker.
|
||||
BOOL bArrow; // TRUE to render arrows for the dropdown.
|
||||
DWORD dwPopup; // Style flags for color popup window.
|
||||
DWORD dwMenuBarPopupID; // Unique ID of the menu bar popup. It is valid if 'bMenuBarPopup' is TRUE.
|
||||
COLORREF clrDefault; // Default color for the color popup window.
|
||||
COLORREF clrColor; // An RGB value for the current color for the color popup window.
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_LVITEMDATA is a stand alone helper structure class. It holds list
|
||||
// item data for a shell list. It is used by CXTShellTreeCtrl, CXTShellTreeView,
|
||||
// CXTShellListCtrl and CXTShellListView.
|
||||
struct XT_LVITEMDATA
|
||||
{
|
||||
ULONG ulAttribs; // Shell item attributes.
|
||||
LPITEMIDLIST lpi; // Pointer to an item ID list.
|
||||
LPSHELLFOLDER lpsfParent; // Points to the parent shell folder item.
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_TVITEMDATA is a stand alone helper structure class. It is used to
|
||||
// create a structure that holds tree item data for a shell tree. It is
|
||||
// used by CXTShellTreeCtrl, CXTShellTreeView, CXTShellListCtrl and CXTShellListView.
|
||||
struct XT_TVITEMDATA
|
||||
{
|
||||
LPITEMIDLIST lpi; // Pointer to an item ID list.
|
||||
LPITEMIDLIST lpifq; // Pointer to an item ID list.
|
||||
LPSHELLFOLDER lpsfParent; // Pointer to the parent shell folder item.
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_CMDINFO is a stand alone helper structure class. It is used by
|
||||
// CXTCommandsListBox and CXTCustCommands during toolbar customization.
|
||||
struct XT_CMDINFO
|
||||
{
|
||||
UINT nCmdID; // Command identifier.
|
||||
HICON hIcon; // Icon associated with the command.
|
||||
LPCTSTR lpszItem; // Text for the menu or toolbar command.
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_OUTBAR_INFO is a stand alone helper structure class. It is used by
|
||||
// CXTOutBarCtrl to store and send information for an Outlook bar folder
|
||||
// or item.
|
||||
struct XT_OUTBAR_INFO
|
||||
{
|
||||
int nIndex; // Index of the item.
|
||||
int nDragTo; // Ending drag index.
|
||||
int nDragFrom; // Starting drag index.
|
||||
bool bFolder; // true if the item is a folder
|
||||
LPCTSTR lpszText; // Item text.
|
||||
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_TCB_ITEM is a stand alone helper structure class. It is used by
|
||||
// CXTTabCtrl and CXTTabView to store information for a particular tab
|
||||
// item.
|
||||
struct XT_TCB_ITEM
|
||||
{
|
||||
UINT uiToolTipId; // Resource ID for the tooltip.
|
||||
CWnd* pWnd; // A CWnd pointer to the window associated with a tab.
|
||||
CString szTabLabel; // User specified label for the tab.
|
||||
CString szToolTipLabel; // Tooltip text for the tab.
|
||||
CString szCondensedLabel; // The label actually being displayed for auto-condensing tabs.
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_DLLVERSIONINFO is a stand alone helper structure class. It is used
|
||||
// to store version information for a specified module.
|
||||
struct XT_DLLVERSIONINFO
|
||||
{
|
||||
DWORD cbSize; // Size of the structure, in bytes. This member <b>must</b> be filled in <b>before</b> calling the function.
|
||||
DWORD dwMajorVersion; // Major version of the DLL. If the DLL's version is 4.0.950, this value will be 4.
|
||||
DWORD dwMinorVersion; // Minor version of the DLL. If the DLL's version is 4.0.950, this value will be 0.
|
||||
DWORD dwBuildNumber; // Build number of the DLL. If the DLL's version is 4.0.950, this value will be 950.
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Identifies the platform for which the DLL was built. This can
|
||||
// be one of the following values:
|
||||
// [ul]
|
||||
// [li]<b>DLLVER_PLATFORM_WINDOWS</b> The DLL was built for all Windows
|
||||
// platforms.[/li]
|
||||
// [li]<b>DLLVER_PLATFORM_NT</b> The DLL was built specifically for
|
||||
// Windows NT.[/li]
|
||||
// [/ul]
|
||||
DWORD dwPlatformID;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_CLRFONT is a stand alone helper structure class. It is used by CXTTreeCtrl
|
||||
// and CXTTreeView to store information for a specified tree item.
|
||||
struct XT_CLRFONT
|
||||
{
|
||||
LOGFONT logfont; // A LOGFONT object that represents the tree item font.
|
||||
COLORREF color; // An RGB value that represents the color for a tree item.
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_TOOLBARDATA is a stand alone helper structure class. It is used
|
||||
// by CXTTabCtrl and CXTTabView to store information for a specified tab
|
||||
// item.
|
||||
struct XT_TOOLBARDATA
|
||||
{
|
||||
WORD wVersion; // Version number should be 1.
|
||||
WORD wWidth; // Width of one bitmap.
|
||||
WORD wHeight; // Height of one bitmap.
|
||||
WORD wItemCount; // Number of items.
|
||||
WORD items[1]; // Array of command IDs. The actual size is 'wItemCount'.
|
||||
|
||||
// Input: nItem - Index of the item to retrieve the command ID for.
|
||||
// Returns: A WORD object that represents the command identifier.
|
||||
// Summary: This function is used by CXTCoolMenu and CXTToolBar to return
|
||||
// the command identifier specified by the index 'nItem'.
|
||||
WORD GetItem(int nItem);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE WORD XT_TOOLBARDATA::GetItem( int nItem ) {
|
||||
return items[nItem];
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_LOGFONT is a self initializing LOGFONT derived structure class. It
|
||||
// will allow you to create or copy a LOGFONT object, and defines the attributes
|
||||
// of a font.
|
||||
struct XT_LOGFONT : public LOGFONT
|
||||
{
|
||||
// Summary: Constructs an XT_LOGFONT object.
|
||||
XT_LOGFONT();
|
||||
|
||||
// Input: logfont - Valid address of a LOGFONT structure.
|
||||
// Summary: Copy constructor will construct an XT_LOGFONT object and copy the
|
||||
// data specified by 'logfont' into the structure's data members.
|
||||
XT_LOGFONT(LOGFONT& logfont);
|
||||
|
||||
// Input: logfont - Valid address of a LOGFONT structure.
|
||||
// Summary: This overloaded operator will copy the data specified by 'logfont'
|
||||
// into the structure's data members.
|
||||
void operator = (LOGFONT& logfont);
|
||||
|
||||
DWORD dwType; // Used to hold the font type, i.e. TT_FONT, DEVICE_FONT.
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE XT_LOGFONT::XT_LOGFONT() {
|
||||
::ZeroMemory(this, sizeof(XT_LOGFONT)); dwType = 0;
|
||||
}
|
||||
AFX_INLINE XT_LOGFONT::XT_LOGFONT( LOGFONT& logfont ) {
|
||||
::CopyMemory((void*)&*this, (const void*) &logfont, (DWORD)sizeof(LOGFONT)); dwType = 0;
|
||||
}
|
||||
AFX_INLINE void XT_LOGFONT::operator = (LOGFONT& logfont) {
|
||||
::CopyMemory((void*)&*this, (const void*)&logfont, (DWORD)sizeof(LOGFONT));
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_MENUITEMINFO is a self initializing MENUITEMINFO derived structure
|
||||
// class. It is used by CXTCoolMenu and CXTMenuBar, and contains
|
||||
// information about menu items.
|
||||
struct _XT_EXT_CLASS XT_MENUITEMINFO : public MENUITEMINFO
|
||||
{
|
||||
// Summary: Constructs an XT_MENUITEMINFO object.
|
||||
XT_MENUITEMINFO();
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_NONCLIENTMETRICS is a self initializing NONCLIENTMETRICS derived
|
||||
// structure class. It contains the scalable metrics associated with the
|
||||
// non-client area of a non-minimized window. This structure is used by
|
||||
// the SPI_GETNONCLIENTMETRICS and SPI_SETNONCLIENTMETRICS actions of
|
||||
// SystemParametersInfo.
|
||||
struct XT_NONCLIENTMETRICS : public NONCLIENTMETRICS
|
||||
{
|
||||
// Summary: Constructs an XT_NONCLIENTMETRICS object.
|
||||
XT_NONCLIENTMETRICS();
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE XT_NONCLIENTMETRICS::XT_NONCLIENTMETRICS() {
|
||||
memset(this, 0, sizeof(NONCLIENTMETRICS)); cbSize = sizeof(NONCLIENTMETRICS); /*// Retrieves the value of the specified system-wide parameter.*/VERIFY(::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), this, 0));
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_REBARSIZECHILDINFO is a stand alone structure class. It is used to
|
||||
// create an XT_REBARSIZECHILDINFO structure.
|
||||
struct XT_REBARSIZECHILDINFO
|
||||
{
|
||||
REBARBANDINFO* pBandInfo; // Points to a REBARBANDINFO structure that contains information that defines a band in a rebar control.
|
||||
NMREBARCHILDSIZE* pSizeInfo; // Points to a NMREBARCHILDSIZE structure that contains information used in handling the RBN_CHILDSIZE notification message.
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_AUX_DATA is a stand alone global item data structure class. It is
|
||||
// used by the toolkit to initialize and store resource and item data shared
|
||||
// by all objects. Items include system colors, icons, fonts and OS flags.
|
||||
struct _XT_EXT_CLASS XT_AUX_DATA
|
||||
{
|
||||
private:
|
||||
|
||||
// Summary: Constructs an XT_AUX_DATA object.
|
||||
XT_AUX_DATA();
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Destroys an XT_AUX_DATA object, handles cleanup and de-allocation.
|
||||
virtual ~XT_AUX_DATA();
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// (RGB) System colors used by Xtreme Toolkit
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
COLORREF clr3DFace; // An RGB value that represents the face color for three dimensional display elements.
|
||||
COLORREF clr3DShadow; // An RGB value that represents the shadow color for three dimensional display elements.
|
||||
COLORREF clr3DDkShadow; // An RGB value that represents the dark shadow for three dimensional display elements.
|
||||
COLORREF clr3DHilight; // An RGB value that represents the highlight color for three dimensional display elements.
|
||||
COLORREF clr3DLight; // An RGB value that represents the light color for three dimensional display elements.
|
||||
COLORREF clrBtnText; // An RGB value that represents the text color on push buttons.
|
||||
COLORREF clrGrayText; // An RGB value that represents the grayed (disabled) text.
|
||||
COLORREF clrHighlight; // An RGB value that represents the item(s) selected in a control.
|
||||
COLORREF clrHighlightText; // An RGB value that represents the text color of item(s) selected in a control.
|
||||
COLORREF clrMenu; // An RGB value that represents the menu background.
|
||||
COLORREF clrMenuText; // An RGB value that represents the text color in menus.
|
||||
COLORREF clrWindow; // An RGB value that represents the window background.
|
||||
COLORREF clrWindowFrame; // An RGB value that represents the window frame.
|
||||
COLORREF clrWindowText; // An RGB value that represents the text color in windows.
|
||||
COLORREF clrActiveCaption; // An RGB value that represents the active window title bar.
|
||||
COLORREF clrInActiveCaption; // An RGB value that represents the inactive window title bar.
|
||||
COLORREF clrGradActiveCapt; // An RGB value that represents the gradient active title bar.
|
||||
COLORREF clrGradInActiveCapt; // An RGB value that represents the gradient inactive title bar.
|
||||
COLORREF clrActiveCaptText; // An RGB value that represents the active caption text.
|
||||
COLORREF clrInactiveCaptText; // An RGB value that represents the inactive caption text.
|
||||
COLORREF clrXPBarFace; // An RGB value that represents the XP toolbar background color.
|
||||
COLORREF clrXPHighlight; // An RGB value that represents the XP menu item selected color.
|
||||
COLORREF clrXPHighlightBorder; // An RGB value that represents the XP menu item selected border color.
|
||||
COLORREF clrXPHighlightPushed; // An RGB value that represents the XP menu item pushed color.
|
||||
COLORREF clrXPIconShadow; // An RGB value that represents the XP menu item icon shadow.
|
||||
COLORREF clrXPGrayText; // An RGB value that represents the XP menu item disabled text color.
|
||||
COLORREF clrXPHighlightChecked; // An RGB value that represents the XP menu item checked color.
|
||||
COLORREF clrXPHighlightCheckedBorder; // An RGB value that represents the XP menu item checked border color.
|
||||
COLORREF clrXPGripper; // An RGB value that represents the XP toolbar gripper color.
|
||||
COLORREF clrXPSeparator; // An RGB value that represents the XP toolbar separator color.
|
||||
COLORREF clrXPDisabled; // An RGB value that represents the XP menu icon disabled color.
|
||||
COLORREF clrXPMenuTextBack; // An RGB value that represents the XP menu item text background color.
|
||||
COLORREF clrXPMenuExpanded; // An RGB value that represents the XP hidden menu commands background color.
|
||||
COLORREF clrXPMenuBorder; // An RGB value that represents the XP menu border color.
|
||||
COLORREF clrXPMenuText; // An RGB value that represents the XP menu item text color.
|
||||
COLORREF clrXPHighlightText; // An RGB value that represents the XP menu item selected text color.
|
||||
COLORREF clrXPBarText; // An RGB value that represents the XP toolbar text color.
|
||||
COLORREF clrXPBarTextPushed; // An RGB value that represents the XP toolbar pushed text color.
|
||||
COLORREF clrXPTabInactiveBack; // An RGB value that represents the XP inactive tab background color.
|
||||
COLORREF clrXPTabInactiveText; // An RGB value that represents the XP inactive tab text color.
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Cursors used by Xtreme Toolkit
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
HCURSOR hcurDragCopy; // Drag copy.
|
||||
HCURSOR hcurDragMove; // Drag move.
|
||||
HCURSOR hcurDragNone; // Drag none.
|
||||
HCURSOR hcurHand; // Hand.
|
||||
HCURSOR hcurHandNone; // No Hand.
|
||||
HCURSOR hcurHSplitBar; // Horizontal Splitter.
|
||||
HCURSOR hcurVSplitBar; // Vertical Splitter.
|
||||
HCURSOR hcurMove; // 4 way move.
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// System metrics for small icons.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
int cxSmIcon; // cx small icon size (width).
|
||||
int cySmIcon; // cy small icon size (height).
|
||||
int cxSize; // Width, in pixels, of a button in a window's caption or title bar.
|
||||
int cySize; // Height, in pixels, of a button in a window's caption or title bar.
|
||||
int cxHThumb; // Width, in pixels, of the thumb box in a horizontal scroll bar.
|
||||
int cyVThumb; // Height, in pixels, of the thumb box in a vertical scroll bar.
|
||||
int cyMenuItem; // Height, in pixels, of single-line menu bar.
|
||||
int nMenuAnimation; // Type of menu animation.
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Fonts used by Xtreme Toolkit
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
CFont font; // Default GUI font.
|
||||
CFont fontBold; // Default bold GUI font.
|
||||
CFont fontULine; // Default underlined GUI font.
|
||||
CFont fontHCapt; // Default horizontal caption font.
|
||||
CFont fontVCapt; // Default vertical caption font.
|
||||
CFont fontVCaptBold; // Default vertical caption bold font.
|
||||
CFont fontVCaptR; // Default vertical caption font, right aligned.
|
||||
CFont fontVCaptRBold; // Default vertical caption bold font, right aligned.
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Fonts used by Xtreme Toolkit ( face name )
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
CString strHorzFont; // Face name of the horizontal font used by the toolkit.
|
||||
CString strVertFont; // Face name of the vertical font used by the toolkit.
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// OS flags used by Xtreme Toolkit
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
int iComCtlVersion; // Common control dll (comctl32.dll) version information.
|
||||
BOOL bWin95; // TRUE if Win 95.
|
||||
BOOL bWin98; // TRUE if Win 98.
|
||||
BOOL bWinNT; // TRUE if Win NT.
|
||||
BOOL bWin2K; // TRUE if Win 2000.
|
||||
BOOL bWinXP; // TRUE if Win XP.
|
||||
BOOL bCoolMenuCompatMode; // TRUE to enable cool menu compatibility mode.
|
||||
BOOL bXPMode; // TRUE to use XP style menus.
|
||||
BOOL bMenuShadows; // TRUE to use shadows under the menus.
|
||||
BOOL bToolBarVisualize; // TRUE to render the toolbar while dragging or resizing.
|
||||
BOOL bControlBarMenus; // TRUE to display right click control bar menus.
|
||||
BOOL bDockBarMenus; // TRUE to display right click dockbar menus.
|
||||
BOOL bMenuRecentCommands; // TRUE to use intelligent menus to hide selected menu commands.
|
||||
BOOL bShowFullAfterDelay; // TRUE to display hidden menu commands after a short delay.
|
||||
BOOL bToolBarScreenTips; // TRUE to show tooltips on toolbar commands.
|
||||
BOOL bToolBarAccelTips; // TRUE to add accelerator keys to toolbar tips.
|
||||
BOOL bDisableFadedIcons; // TRUE to disable icons fading .
|
||||
BOOL bUseSolidShadows; // TRUE to use solid shadows in Operation Systems that are not supported layered windows.
|
||||
CString strINIFileName; // Name of an ini file for registry settings.
|
||||
HINSTANCE hInstance; // Instance handle for resources.
|
||||
|
||||
// Summary: This member function loads the cursors used by Xtreme Toolkit.
|
||||
void LoadSysCursors();
|
||||
|
||||
// Summary: This member function frees cursor resources.
|
||||
void FreeSysCursors();
|
||||
|
||||
// Summary: This member function creates the fonts used by Xtreme Toolkit.
|
||||
void LoadSysFonts();
|
||||
|
||||
// Summary: This member function frees font resources.
|
||||
void FreeSysFonts();
|
||||
|
||||
// Summary: This member function updates system colors used by Xtreme Toolkit.
|
||||
void UpdateSysColors();
|
||||
|
||||
// Summary: This member function updates system metrics used by Xtreme Toolkit.
|
||||
void UpdateSysMetrics();
|
||||
|
||||
// Returns: A DWORD value.
|
||||
// Summary: This member function is called to retrieve the version information
|
||||
// for the common control dll (comctl32.dll).
|
||||
DWORD GetComCtlVersion();
|
||||
|
||||
// Input: hInst - Instance handle for resources.
|
||||
// Summary: This member function is called by the library to initialize resources.
|
||||
void InitResources(HINSTANCE hInst);
|
||||
|
||||
// Input: pFont - Points to a valid CFont object that is used to define the fonts
|
||||
// the toolkit will use.
|
||||
// pVertFont - Points to a valid CFont object that is used to define the vertical
|
||||
// fonts used by the toolkit. If NULL, 'pFont' will be used.
|
||||
// Example: <pre>CGUI_VisualStudioApp::CGUI_VisualStudioApp()
|
||||
// {
|
||||
// // TODO: add construction code here,
|
||||
// m_bFirstTime = true;
|
||||
//
|
||||
// // Place all significant initialization in InitInstance
|
||||
// xtAfxData.SetGlobalFont( _T( "Verdana" ) );
|
||||
// }</pre>
|
||||
// Summary: Call this member function to set the font the toolkit will use.
|
||||
// This member function should be called from the constructor of your
|
||||
// CWinApp derived class for the fonts to be properly initialized.
|
||||
void SetGlobalFont(CFont* pFont,CFont* pVertFont=NULL);
|
||||
|
||||
// Input: lpszFaceName - Points to a NULL terminated string that is used to define the fonts
|
||||
// the toolkit will use.
|
||||
// lpszVertFaceName - Points to a NULL terminated string that is used to define the vertical
|
||||
// fonts used by the toolkit. If NULL, the name defined in 'lpszFaceName'
|
||||
// will be used.
|
||||
// Example: <pre>CGUI_VisualStudioApp::CGUI_VisualStudioApp()
|
||||
// {
|
||||
// // TODO: add construction code here,
|
||||
// m_bFirstTime = true;
|
||||
//
|
||||
// // Place all significant initialization in InitInstance
|
||||
// xtAfxData.SetGlobalFont( _T( "Verdana" ) );
|
||||
// }</pre>
|
||||
// Summary: Call this member function to set the font the toolkit will use.
|
||||
// This member function should be called from the constructor of your
|
||||
// CWinApp derived class for the fonts to be properly initialized.
|
||||
void SetGlobalFont(LPCTSTR lpszFaceName,LPCTSTR lpszVertFaceName=NULL);
|
||||
|
||||
// Input: lpszINIFullPath - Full path to the ini file.
|
||||
// Summary: Call this member function to store registry settings in an ini file
|
||||
// instead of the system's registry.
|
||||
void SetINIFileName(LPCTSTR lpszINIFullPath);
|
||||
|
||||
// Returns: An LPCTSTR data type.
|
||||
// Summary: This member function will get the full path to the ini file
|
||||
// used to store registry settings.
|
||||
LPCTSTR GetINIFileName();
|
||||
|
||||
// Returns: A reference to the one and only XT_AUX_DATA object.
|
||||
// Example: <pre>XT_AUX_DATA::Get().InitResources( m_hInstance );</pre>
|
||||
// Summary: This static member function will retrieve a reference to the one
|
||||
// and only XT_AUX_DATA object. You can use this function to access
|
||||
// data members for the XT_AUX_DATA structure. You can also use the
|
||||
// macro xtAfxData.
|
||||
static XT_AUX_DATA& Get();
|
||||
|
||||
// Input: bVerNumOnly - true to return the version number only, minus "Xtreme Toolkit v".
|
||||
// Returns: A NULL terminated string that indicates the version of the Xtreme Toolkit.
|
||||
// Summary: Call this member function to retrieve a CString object that represents
|
||||
// the current version of the Xtreme Toolkit. The string returned is
|
||||
// formatted like so: "Xtreme Toolkit v1.94".
|
||||
CString GetXTVersion(bool bVerNumOnly=false);
|
||||
|
||||
private:
|
||||
bool FontExists(CString& strFaceName);
|
||||
bool CreateSysFont(XT_LOGFONT& lf, CFont& font, long lfWeight=FW_NORMAL, char lfUnderline=0, long lfOrientation=0, long lfEscapement=0);
|
||||
};
|
||||
|
||||
//:Associate with "Global Data"
|
||||
|
||||
// Summary: XT_AUX_DATA is a singleton object and can only be instantiated
|
||||
// one time. The macro xtAfxData is used to access the members of this
|
||||
// structure.
|
||||
#define xtAfxData XT_AUX_DATA::Get()
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTIconHandle is a stand alone helper class. It is used to automatically
|
||||
// destroy dynamically created hIcon handles.
|
||||
class _XT_EXT_CLASS CXTIconHandle
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTIconHandle object.
|
||||
CXTIconHandle();
|
||||
|
||||
// Input: hIcon - Handle to a dynamically created icon.
|
||||
// Summary: Constructs a CXTIconHandle object.
|
||||
CXTIconHandle(HICON hIcon);
|
||||
|
||||
// Summary: Destroys a CXTIconHandle object, handles cleanup and de-allocation.
|
||||
virtual ~CXTIconHandle();
|
||||
|
||||
protected:
|
||||
|
||||
HICON m_hIcon; // Handle to a dynamically created icon.
|
||||
|
||||
public:
|
||||
|
||||
// Returns: An HICON handle to the icon.
|
||||
// Summary: This operator is used to retrieve a handle to the icon associated with
|
||||
// the CXTIconHandle object.
|
||||
operator HICON() const;
|
||||
|
||||
// Input: hIcon - Handle to a dynamically created icon.
|
||||
// Summary: This operator is used to initialize the icon associated with the
|
||||
// CXTIconHandle object.
|
||||
CXTIconHandle& operator =(HICON hIcon);
|
||||
|
||||
// Input: hIcon - Icon handle whose dimensions are to be retrieved.
|
||||
// Returns: A CSize object.
|
||||
// Summary: This member function gets the extent of an icon.
|
||||
static CSize GetExtent(HICON hIcon);
|
||||
|
||||
// Returns: A CSize object.
|
||||
// Summary: This member function gets the extent of an icon attached to this object.
|
||||
CSize GetExtent() const;
|
||||
|
||||
// Input: hIcon - Icon to be fitted.
|
||||
// desiredExtent - Desired icon extent.
|
||||
// Returns: An icon handle.
|
||||
// Summary: This member function scales an icon to fit into a rectangle. The width
|
||||
// and height ration is retained as much as possible. The caller assumes
|
||||
// ownership of the returned icon handle.
|
||||
static HICON ScaleToFit(HICON hIcon,CSize desiredExtent);
|
||||
|
||||
// Input: desiredExtent - Desired icon extent.
|
||||
// Returns: An icon handle.
|
||||
// Summary: This member function scales an icon to fit into a rectangle. The width
|
||||
// and height ration is retained as much as possible. The caller assumes
|
||||
// ownership of the returned icon handle.
|
||||
HICON ScaleToFit(CSize desiredExtent) const;
|
||||
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTLoadLibrary is a stand alone utility class. It is used to load a
|
||||
// module (DLL) and free the instance handle upon destruction. It wraps
|
||||
// the LoadLibrary and the FreeLibrary API's.
|
||||
class _XT_EXT_CLASS CXTLoadLibrary
|
||||
{
|
||||
public:
|
||||
|
||||
// Input: lpszModule - Pointer to a null-terminated string that names the .DLL file. The
|
||||
// name specified is the filename of the module and is not related to
|
||||
// the name stored in the library module itself, as specified by the
|
||||
// LIBRARY keyword in the module-definition (.DEF) file.
|
||||
//
|
||||
// If the string specifies a path but the file does not exist in
|
||||
// the specified directory, the function fails. When specifying a path,
|
||||
// be sure to use backslashes (\), not forward slashes (/).
|
||||
// Summary: Constructs a CXTLoadLibrary object.
|
||||
CXTLoadLibrary(LPCTSTR lpszModule=NULL);
|
||||
|
||||
// Summary: Destroys a CXTLoadLibrary object, handles cleanup and de-allocation.
|
||||
virtual ~CXTLoadLibrary();
|
||||
|
||||
protected:
|
||||
|
||||
HINSTANCE m_hInstance; // A handle to the module indicates success.
|
||||
|
||||
public:
|
||||
|
||||
// Input: lpszModule - Pointer to a null-terminated string that names the .DLL file. The
|
||||
// name specified is the filename of the module and is not related to
|
||||
// the name stored in the library module itself, as specified by the
|
||||
// LIBRARY keyword in the module-definition (.DEF) file.
|
||||
//
|
||||
// If the module does not exist in the specified directory, the
|
||||
// function will fail. When specifying a path, be sure to use backslashes
|
||||
// (\), not forward slashes (/).
|
||||
// Summary: This member function is called to load the library specified by
|
||||
// 'lpszModule'. Once the library is loaded, you can retrieve the instance
|
||||
// handle by using the HINSTANCE operator.
|
||||
void LoadLibrary(LPCTSTR lpszModule);
|
||||
|
||||
// Returns: A handle to the module if successful, otherwise returns NULL.
|
||||
// Summary: This overloaded operator returns a handle to the module indicating
|
||||
// success. NULL indicates failure.
|
||||
operator HINSTANCE() const;
|
||||
|
||||
// Returns: A DWORD value if successful, otherwise 0L.
|
||||
// Summary: Use this member function to return the version number of the
|
||||
// module attached to this CLoadLibrary object. The high-order
|
||||
// word of the return value represents the major version number and
|
||||
// the low-order word of the returned value represents the minor
|
||||
// version number.
|
||||
DWORD GetModuleVersion();
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE CXTLoadLibrary::operator HINSTANCE() const {
|
||||
return m_hInstance;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTNoFlickerWnd is a BASE_CLASS derived general purpose template helper
|
||||
// class. CXTNoFlickerWnd class is used for drawing flicker free controls.
|
||||
// To use, instantiate the template using any CWnd derived class. For example,
|
||||
// to create a tab control that is flicker free you would use the
|
||||
// following declaration:
|
||||
//
|
||||
// <pre>CXTNoFlickerWnd <CTabCtrl> m_tabCtrl;</pre>
|
||||
template<class BASE_CLASS>
|
||||
class CXTNoFlickerWnd : public BASE_CLASS
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTNoFlickerWnd object.
|
||||
inline CXTNoFlickerWnd() {m_crBack = xtAfxData.clr3DFace;}
|
||||
|
||||
// Input: crBack - An RGB value.
|
||||
// Summary: This member function is called to set the background fill
|
||||
// color for the flicker free control.
|
||||
inline void SetBackColor(COLORREF crBack) {m_crBack = crBack;}
|
||||
|
||||
// Returns: An RGB value.
|
||||
// Summary: This member function is called to retrieve the background fill color
|
||||
// for the flicker free control.
|
||||
inline COLORREF GetBackColor() {
|
||||
return m_crBack; // An RGB value.
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
COLORREF m_crBack; // An RGB value.
|
||||
|
||||
// Input: message - Specifies the Windows message to be processed.
|
||||
// wParam - Provides additional information used in processing the message. The
|
||||
// parameter value depends on the message.
|
||||
// lParam - Provides additional information used in processing the message. The
|
||||
// parameter value depends on the message.
|
||||
// Returns: The return value depends on the message.
|
||||
// Summary: This method provides a CE procedure (WindowProc) for a CWnd object.
|
||||
// It dispatches messages through the window message map.
|
||||
virtual LRESULT WindowProc(UINT message,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_PAINT:
|
||||
{
|
||||
CPaintDC dc(this);
|
||||
|
||||
// Get the client rect, and paint to a memory device context. This
|
||||
// will help reduce screen flicker. Pass the memory device context to the
|
||||
// default window procedure to do default painting.
|
||||
|
||||
CRect r;
|
||||
GetClientRect(&r);
|
||||
CXTMemDC memDC(&dc, r, m_crBack);
|
||||
|
||||
return BASE_CLASS::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );
|
||||
}
|
||||
|
||||
case WM_ERASEBKGND:
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return BASE_CLASS::WindowProc(message, wParam, lParam);
|
||||
}
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTDialogState is a stand alone class. It is an internal class used
|
||||
// by toolkit dialogs to manage resource context.
|
||||
class CXTDialogState
|
||||
{
|
||||
protected:
|
||||
|
||||
// Summary: Constructs a CXTDialogState object.
|
||||
CXTDialogState();
|
||||
|
||||
// Summary: Destroys a CXTDialogState object, handles cleanup and de-allocation.
|
||||
~CXTDialogState();
|
||||
|
||||
// Summary: Restores the application resource context. Should be used within
|
||||
// the derived class's constructor.
|
||||
void RevertResourceContext();
|
||||
|
||||
class CXTManageState *m_pState; // A pointer is used so we don't have to include the definition of the private CXTManageState in a public header
|
||||
};
|
||||
|
||||
#if _MSC_VER < 1200 // MFC 5.0
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CXTString class is for VC5 CString compatibility only.
|
||||
|
||||
class _XT_EXT_CLASS CXTString : public CString
|
||||
{
|
||||
public:
|
||||
|
||||
CXTString() { }
|
||||
CXTString(CString strIn);
|
||||
int Find(LPCTSTR lpszSub, int nStart) const;
|
||||
int Find( TCHAR ch ) const { return CString::Find(ch); }
|
||||
int Find( LPCTSTR lpszSub ) const { return CString::Find(lpszSub); }
|
||||
int Insert(int nIndex, TCHAR ch);
|
||||
int Insert(int nIndex, LPCTSTR pstr);
|
||||
const CString& operator =( const CString& stringSrc ) { return CString::operator =(stringSrc); }
|
||||
const CString& operator =( TCHAR ch ) { return CString::operator =(ch); }
|
||||
const CString& operator =( const unsigned char* psz ) { return CString::operator =(psz); }
|
||||
const CString& operator =( LPCWSTR lpsz ) { return CString::operator =(lpsz); }
|
||||
const CString& operator =( LPCSTR lpsz ) { return CString::operator =(lpsz); }
|
||||
int Remove(TCHAR chRemove);
|
||||
int Replace(TCHAR chOld, TCHAR chNew);
|
||||
int Replace(LPCTSTR lpszOld, LPCTSTR lpszNew);
|
||||
int Delete(int nIndex, int nCount=1);
|
||||
CXTString Left(int nCount) const;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
typedef CString CXTString;
|
||||
|
||||
#endif // MFC 5.0
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTGLOBALS_H__)
|
||||
427
Editor/XT/Include/XTHexEdit.h
Normal file
427
Editor/XT/Include/XTHexEdit.h
Normal file
@@ -0,0 +1,427 @@
|
||||
// XTHexEdit.h interface for the CXTHexEdit class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//--------------------------------------------------------------------
|
||||
// Based on the code created by Andreas Saurwein
|
||||
// mailto:saurwein@uniwares.de
|
||||
//--------------------------------------------------------------------
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTHEXEDIT_H__)
|
||||
#define __XTHEXEDIT_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTHexEdit is a CEdit derived class. It is used to create an edit control
|
||||
// which will allow editing in hex display format.
|
||||
class _XT_EXT_CLASS CXTHexEdit : public CEdit
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTHexEdit)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTHexEdit object.
|
||||
CXTHexEdit();
|
||||
|
||||
// Summary: Destroys a CXTHexEdit object, handles cleanup and de-allocation.
|
||||
virtual ~CXTHexEdit();
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Enumerated value that represents the current editing mode.
|
||||
enum EDITMODE
|
||||
{
|
||||
EDIT_NONE, // No editing mode specified.
|
||||
EDIT_ASCII, // ASCII editing mode.
|
||||
EDIT_HIGH, // High editing mode.
|
||||
EDIT_LOW // Low editing mode.
|
||||
};
|
||||
|
||||
int m_nLength; // Length of data.
|
||||
int m_nTopIndex; // Offset of first visible byte on the screen.
|
||||
int m_nCurrentAddress; // Address under the cursor.
|
||||
int m_nSelStart; // Start address of the selection.
|
||||
int m_nSelEnd; // End address of the selection.
|
||||
int m_nBytePerRow; // Bytes per row.
|
||||
int m_nLinesPerPage; // Lines per page.
|
||||
int m_nLineHeight; // Height, in pixels, of a single line displayed in the control.
|
||||
int m_nNullWidth; // Width, in pixels, of a single character displayed in the control (uniform width).
|
||||
int m_nOffHex; // Internally used value - X position where hex part starts.
|
||||
int m_nOffAscii; // Internally used value - X position where ASCII part starts.
|
||||
int m_nOffAddress; // Internally used value - X position where address part starts.
|
||||
bool m_bAllowDeletes; // A boolean value indicating whether or not deletions are allowed.
|
||||
BOOL m_bDynamicBPR; // Calculate bytes-per-row dynamically.
|
||||
BOOL m_bShowAddress; // TRUE when showing the address part.
|
||||
BOOL m_bShowAscii; // TRUE when showing the ASCII part.
|
||||
BOOL m_bShowHex; // TRUE when showing the hex part.
|
||||
BOOL m_bAddressIsWide; // 4/8 byte address.
|
||||
BOOL m_bUpdate; // Value used internally to indicate that the font and size info need to be updated on the next paint cycle.
|
||||
UINT m_nMaxLength; // Maximum size of data.
|
||||
DWORD m_dwBaseAddress; // Base address for data.
|
||||
CPoint m_ptEditPos; // Current caret position.
|
||||
LPBYTE m_pData; // Pointer to data.
|
||||
EDITMODE m_eEditMode; // Current editing mode: address/hex/ASCII.
|
||||
|
||||
protected:
|
||||
|
||||
BOOL m_bShowCaret; // TRUE to display a flashing caret at the current caret position.
|
||||
CSize m_szCaret; // Current size of caret.
|
||||
CFont m_fontHex; // Represents the default font used by the hex edit control.
|
||||
COLORREF m_crBack; // RGB value that represents the background color of the hex edit control.
|
||||
COLORREF m_crText; // RGB value that represents the text color of the hex edit control.
|
||||
COLORREF m_crDisabledBack; // RGB value that represents the disabled background color for the hex edit control.
|
||||
COLORREF m_crDisabledText; // RGB value that represents the disabled text color of the hex edit control.
|
||||
COLORREF m_crHighlightText; // RGB value that represents the highlighted text color of the hex edit control.
|
||||
COLORREF m_crHighlightBack; // RGB value that represents the highlighted background color of the hex edit control.
|
||||
COLORREF m_crDisabledHighlightText; // RGB value that represents the disabled highlighted text color of the hex edit control.
|
||||
COLORREF m_crDisabledHighlightBack; // RGB value that represents the disabled highlighted background color of the hex edit control.
|
||||
|
||||
public:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTHexEdit)
|
||||
public:
|
||||
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
|
||||
protected:
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
public:
|
||||
|
||||
// Returns: An RGB value that represents the current background color for the control.
|
||||
// Summary: Call this member function to return the current background color for
|
||||
// the hex edit control. The current background color depends on the
|
||||
// enabled, disabled, or read-only state of the control.
|
||||
COLORREF GetActualBackColor();
|
||||
|
||||
// Returns: An RGB value that represents the current text color for the control.
|
||||
// Summary: Call this member function to return the current text color for the hex
|
||||
// edit control. The current text color depends on the enabled, disabled,
|
||||
// or read-only state of the control.
|
||||
COLORREF GetActualTextColor();
|
||||
|
||||
// Returns: An RGB value that represents the current highlight background
|
||||
// color for the control.
|
||||
// Summary: Call this member function to return the current highlight background
|
||||
// color for the hex edit control. The current highlight background color
|
||||
// depends on the enabled, disabled, or read-only state of the control.
|
||||
COLORREF GetActualHighlightBackColor();
|
||||
|
||||
// Returns: An RGB value that represents the current highlight text color for the
|
||||
// control.
|
||||
// Summary: Call this member function to return the current highlight text color
|
||||
// for the hex edit control. The current highlight text color depends
|
||||
// on the enabled, disabled, or read-only state of the control.
|
||||
COLORREF GetActualHighlightTextColor();
|
||||
|
||||
// Input: crBack - An RGB value that represents the background color of the hex edit
|
||||
// control.
|
||||
// Summary: Call this member function to set the background color for the hex edit
|
||||
// control.
|
||||
void SetBackColor(COLORREF crBack);
|
||||
|
||||
// Returns: An RGB value that represents the current background color for the hex edit
|
||||
// control.
|
||||
// Summary: Call this member function to retrieve the current background color
|
||||
// for the hex edit control.
|
||||
COLORREF GetBackColor();
|
||||
|
||||
// Input: crText - An RGB value that represents the text color of the hex edit control.
|
||||
// Summary: Call this member function to set the text color for the hex edit control.
|
||||
void SetTextColor(COLORREF crText);
|
||||
|
||||
// Returns: An RGB value that represents the current text color for the hex edit control.
|
||||
// Summary: Call this member function to retrieve the current text color for the
|
||||
// hex edit control.
|
||||
COLORREF GetTextColor();
|
||||
|
||||
// Input: crDisabledBack - An RGB value that represents the disabled background color of the
|
||||
// hex edit control.
|
||||
// Summary: Call this member function to set the disabled background color for
|
||||
// the hex edit control.
|
||||
void SetDisabledBackColor(COLORREF crDisabledBack);
|
||||
|
||||
// Returns: An RGB value that represents the current disabled background color for the hex
|
||||
// edit control.
|
||||
// Summary: Call this member function to retrieve the current disabled background
|
||||
// color for the hex edit control.
|
||||
COLORREF GetDisabledBackColor();
|
||||
|
||||
// Input: crDisabledText - An RGB value that represents the disabled text color of the hex edit
|
||||
// control.
|
||||
// Summary: Call this member function to set the disabled text color for the hex
|
||||
// edit control.
|
||||
void SetDisabledTextColor(COLORREF crDisabledText);
|
||||
|
||||
// Returns: An RGB value that represents the current disabled text color for the hex
|
||||
// edit control.
|
||||
// Summary: Call this member function to retrieve the current disabled text color
|
||||
// for the hex edit control.
|
||||
COLORREF GetDisabledTextColor();
|
||||
|
||||
// Input: crHighlightText - An RGB value that represents the highlighted text color of the hex
|
||||
// edit control.
|
||||
// Summary: Call this member function to set the highlighted text color for the
|
||||
// hex edit control.
|
||||
void SetHighlightTextColor(COLORREF crHighlightText);
|
||||
|
||||
// Returns: An RGB value that represents the current highlighted text color for the
|
||||
// hex edit control.
|
||||
// Summary: Call this member function to retrieve the current highlighted text
|
||||
// color for the hex edit control.
|
||||
COLORREF GetHighlightTextColor();
|
||||
|
||||
// Input: crHighlight - An RGB value that represents the highlight background color of the
|
||||
// hex edit control.
|
||||
// Summary: Call this member function to set the highlight background color for
|
||||
// the hex edit control.
|
||||
void SetHighlightBackColor(COLORREF crHighlight);
|
||||
|
||||
// Returns: An RGB value that represents the current highlight background color for the
|
||||
// hex edit control.
|
||||
// Summary: Call this member function to retrieve the current highlight background
|
||||
// color for the hex edit control.
|
||||
COLORREF GetHighlightBackColor();
|
||||
|
||||
// Input: crDisabledHighlightText - An RGB value that represents the disabled highlight
|
||||
// text color of the hex edit control.
|
||||
// Summary: Call this member function to set the disabled highlight text color for
|
||||
// the hex edit control.
|
||||
void SetDisabledHighlightTextColor(COLORREF crDisabledHighlightText);
|
||||
|
||||
// Returns: An RGB value that represents the current disabled highlight text color
|
||||
// for the hex edit control.
|
||||
// Summary: Call this member function to retrieve the current disabled highlight
|
||||
// text color for the hex edit control.
|
||||
COLORREF GetDisabledHighlightTextColor();
|
||||
|
||||
// Input: crDisabledHighlight - An RGB value that represents the disabled highlight background color
|
||||
// of the hex edit control.
|
||||
// Summary: Call this member function to set the disabled highlight background
|
||||
// color for the hex edit control.
|
||||
void SetDisabledHighlightBackColor(COLORREF crDisabledHighlight);
|
||||
|
||||
// Returns: An RGB value that represents the current disabled highlight background color
|
||||
// for the hex edit control.
|
||||
// Summary: Call this member function to retrieve the current disabled highlight
|
||||
// background color for the hex edit control.
|
||||
COLORREF GetDisabledHighlightBackColor();
|
||||
|
||||
// Summary: This member function sets the font for the hex edit control to the
|
||||
// default "Courier New" font.
|
||||
void RestoreDefaultFont();
|
||||
|
||||
// Input: pFont - Points to a valid CFont object.
|
||||
// Summary: This member function sets the font used by the hex edit control.
|
||||
void SetHexFont(CFont* pFont);
|
||||
|
||||
// Input: pLogFont - Points to a valid LOGFONT structure.
|
||||
// Summary: This member function sets the font used by the hex edit control.
|
||||
void SetHexFont(LOGFONT* pLogFont);
|
||||
|
||||
// Input: bEnable - true to enable caret, false to disable.
|
||||
// Summary: This member function enables or disables a flashing screen caret.
|
||||
void EnableCaret(bool bEnable);
|
||||
|
||||
// Input: bVertical - true to display vertical scroll bar.
|
||||
// bHorizontal - true to display horizontal scroll bar.
|
||||
// Summary: This member function enables or disables a vertical and horizontal scroll
|
||||
// bar display.
|
||||
void EnableScrollBars(bool bVertical,bool bHorizontal);
|
||||
|
||||
// Input: dwBase - DWORD value that represents the base address.
|
||||
// Returns: A DWORD value.
|
||||
// Summary: Call this member function to set the base address for the hex edit
|
||||
// control.
|
||||
DWORD SetAddressBase(DWORD dwBase);
|
||||
|
||||
// Input: pData - Pointer to the buffer that will be receiving the data.
|
||||
// nBufferLength - Length of the target data buffer.
|
||||
// Returns: The length of the data.
|
||||
// Summary: Call this method to extract the data in the hex edit control.
|
||||
int GetData(LPBYTE pData,int nBufferLength);
|
||||
|
||||
// Input: pData - Pointer to a buffer that contains the initial data for the control.
|
||||
// nLength - Length of the data buffer.
|
||||
// nMaxLength - Optional maximum length that the buffer can grow, or -1 if you
|
||||
// want to allow the buffer to grow indefinitely.
|
||||
// Summary: Call this member function to initialize the hex edit control with data
|
||||
// specified by 'pData'.
|
||||
void SetData(LPBYTE pData,int nLength,int nMaxLength = 0);
|
||||
|
||||
// Input: bVal - The new value for this setting.
|
||||
// Returns: The previous value.
|
||||
// Summary: Call this method to allow or disallow the deletion of characters
|
||||
// within the control. For instance, calling SetAllowDeletes(false) will
|
||||
// disable the delete, backspace, and other such keys.
|
||||
bool SetAllowDeletes(bool bVal = true);
|
||||
|
||||
// Returns: true if the Allow Deletes setting is enabled, or false if it is disabled.
|
||||
// Summary: This member function retrieves the current value of the Allow Deletes
|
||||
// setting.
|
||||
// See Also: SetAllowDeletes
|
||||
bool GetAllowDeletes() const;
|
||||
|
||||
// Returns: A CSize object.
|
||||
// Summary: Call this member function to get the size of the current selection.
|
||||
CSize GetSel();
|
||||
|
||||
// Input: nSelStart - Represents the position of the first character in the selection.
|
||||
// nSelEnd - Represents the position of the last character in the selection.
|
||||
// Summary: Call this member function to set the current selection.
|
||||
void SetSel(int nSelStart,int nSelEnd);
|
||||
|
||||
// Input: nBytePerRow - Represents the number of bytes to display.
|
||||
// Summary: Call this member function to set the number of bytes per row.
|
||||
void SetBPR(int nBytePerRow);
|
||||
|
||||
// Input: bShowAddress - TRUE to display the address value.
|
||||
// bShowHex - TRUE to display the hex value.
|
||||
// bShowAscii - TRUE to display the ASCII value.
|
||||
// bAddressIsWide - TRUE if the display is 8 byte, FALSE for 4 byte display.
|
||||
// Summary: Call this member function to set the display options for the hex edit
|
||||
// control.
|
||||
void SetOptions(BOOL bShowAddress,BOOL bShowHex,BOOL bShowAscii,BOOL bAddressIsWide);
|
||||
|
||||
protected:
|
||||
|
||||
void ScrollIntoView(int pData);
|
||||
void RepositionCaret(int pData);
|
||||
void Move(int x, int y);
|
||||
BOOL IsSelected();
|
||||
void UpdateScrollbars();
|
||||
void CreateEditCaret();
|
||||
void CreateAddressCaret();
|
||||
CPoint CalcPos(int x, int y);
|
||||
void SelInsert(int nSelStart, int nLength);
|
||||
void SelDelete(int nSelStart, int nSelEnd);
|
||||
void NormalizeSel();
|
||||
void RecalcBPR();
|
||||
void DoVScroll(UINT nSBCode, bool bMoveCaret);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTHexEdit)
|
||||
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg void OnKillFocus(CWnd* pNewWnd);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnSetFocus(CWnd* pOldWnd);
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
||||
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
||||
afx_msg UINT OnGetDlgCode();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg void OnContextMenu(CWnd*, CPoint point);
|
||||
afx_msg void OnEditClear();
|
||||
afx_msg void OnEditCopy();
|
||||
afx_msg void OnEditCut();
|
||||
afx_msg void OnEditPaste();
|
||||
afx_msg void OnEditSelectAll();
|
||||
afx_msg void OnEditUndo();
|
||||
afx_msg void OnNcPaint();
|
||||
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE UINT CXTHexEdit::OnGetDlgCode() {
|
||||
return DLGC_WANTALLKEYS;
|
||||
}
|
||||
AFX_INLINE void CXTHexEdit::SetOptions(BOOL bShowAddress, BOOL bShowHex, BOOL bShowAscii, BOOL bAddressIsWide) {
|
||||
m_bShowHex = bShowHex; m_bShowAscii = bShowAscii; m_bShowAddress = bShowAddress; m_bAddressIsWide = bAddressIsWide; m_bUpdate = TRUE; RepositionCaret(m_nCurrentAddress);
|
||||
}
|
||||
AFX_INLINE void CXTHexEdit::SetBPR(int nBytePerRow) {
|
||||
m_nBytePerRow = nBytePerRow; m_bUpdate = TRUE; RepositionCaret(m_nCurrentAddress);
|
||||
}
|
||||
AFX_INLINE BOOL CXTHexEdit::IsSelected() {
|
||||
return m_nSelStart != 0xffffffff;
|
||||
}
|
||||
AFX_INLINE CSize CXTHexEdit::GetSel() {
|
||||
return CSize(m_nSelStart, m_nSelEnd);
|
||||
}
|
||||
AFX_INLINE int CXTHexEdit::GetData(LPBYTE pData, int nLength) {
|
||||
memcpy(pData, m_pData, __min(nLength, m_nLength)); return m_nLength;
|
||||
}
|
||||
AFX_INLINE void CXTHexEdit::SetBackColor(COLORREF crBack) {
|
||||
m_crBack = crBack;
|
||||
}
|
||||
AFX_INLINE void CXTHexEdit::SetTextColor(COLORREF crText) {
|
||||
m_crText = crText;
|
||||
}
|
||||
AFX_INLINE void CXTHexEdit::SetDisabledBackColor(COLORREF crDisabledBack) {
|
||||
m_crDisabledBack = crDisabledBack;
|
||||
}
|
||||
AFX_INLINE void CXTHexEdit::SetDisabledTextColor(COLORREF crDisabledText) {
|
||||
m_crDisabledText = crDisabledText;
|
||||
}
|
||||
AFX_INLINE void CXTHexEdit::SetHighlightTextColor(COLORREF crHighlightText) {
|
||||
m_crHighlightText = crHighlightText;
|
||||
}
|
||||
AFX_INLINE void CXTHexEdit::SetHighlightBackColor(COLORREF crHighlightBack) {
|
||||
m_crHighlightBack = crHighlightBack;
|
||||
}
|
||||
AFX_INLINE void CXTHexEdit::SetDisabledHighlightTextColor(COLORREF crDisabledHighlightText) {
|
||||
m_crDisabledHighlightText = crDisabledHighlightText;
|
||||
}
|
||||
AFX_INLINE void CXTHexEdit::SetDisabledHighlightBackColor(COLORREF crDisabledHighlightBack) {
|
||||
m_crDisabledHighlightBack = crDisabledHighlightBack;
|
||||
}
|
||||
AFX_INLINE COLORREF CXTHexEdit::GetBackColor() {
|
||||
return m_crBack;
|
||||
}
|
||||
AFX_INLINE COLORREF CXTHexEdit::GetTextColor() {
|
||||
return m_crText;
|
||||
}
|
||||
AFX_INLINE COLORREF CXTHexEdit::GetDisabledBackColor() {
|
||||
return m_crDisabledBack;
|
||||
}
|
||||
AFX_INLINE COLORREF CXTHexEdit::GetDisabledTextColor() {
|
||||
return m_crDisabledText;
|
||||
}
|
||||
AFX_INLINE COLORREF CXTHexEdit::GetHighlightTextColor() {
|
||||
return m_crHighlightText;
|
||||
}
|
||||
AFX_INLINE COLORREF CXTHexEdit::GetHighlightBackColor() {
|
||||
return m_crHighlightBack;
|
||||
}
|
||||
AFX_INLINE COLORREF CXTHexEdit::GetDisabledHighlightTextColor() {
|
||||
return m_crDisabledHighlightText;
|
||||
}
|
||||
AFX_INLINE COLORREF CXTHexEdit::GetDisabledHighlightBackColor() {
|
||||
return m_crDisabledHighlightBack;
|
||||
}
|
||||
AFX_INLINE void CXTHexEdit::EnableCaret(bool bEnable) {
|
||||
m_bShowCaret = bEnable;
|
||||
}
|
||||
|
||||
AFX_INLINE bool CXTHexEdit::SetAllowDeletes(bool bVal) {
|
||||
const bool bOldVal = m_bAllowDeletes; m_bAllowDeletes = bVal; return bOldVal;
|
||||
}
|
||||
|
||||
AFX_INLINE bool CXTHexEdit::GetAllowDeletes() const {
|
||||
return m_bAllowDeletes;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTHEXEDIT_H__)
|
||||
791
Editor/XT/Include/XTHtmlView.h
Normal file
791
Editor/XT/Include/XTHtmlView.h
Normal file
@@ -0,0 +1,791 @@
|
||||
// XTHtmlView.h interface for the CXTHtmlView class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTHTMLVIEW_H__)
|
||||
#define __XTHTMLVIEW_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTHtmlView is a CFormView derived class. The CXTHtmlView class provides
|
||||
// the functionality of the WebBrowser control within the context of MFC's
|
||||
// document/view architecture. The WebBrowser control is a window in which
|
||||
// the user can browse sites on the World Wide Web, as well as folders
|
||||
// in the local file system and on a network. The WebBrowser control supports
|
||||
// hyperlinking, Uniform Resource Locator (URL) navigation, and maintains
|
||||
// a history list.
|
||||
//
|
||||
// <b>Using the CXTHtmlView Class in an MFC Application</b>
|
||||
//
|
||||
// In the standard MFC framework application (either SDI or MDI based),
|
||||
// the view object is commonly derived from a specialized set of classes.
|
||||
// These classes, all derived from CView, provide specialized functionality
|
||||
// beyond that provided by CView.
|
||||
//
|
||||
// Basing the application's view class on CXTHtmlView provides the view
|
||||
// with the WebBrowser control. This effectively makes the application
|
||||
// a web browser. The preferred method of creating a web browser-style
|
||||
// application is to use the MFC AppWizard, and specify CXTHtmlView as
|
||||
// the view class. For more information on implementing and using the
|
||||
// WebBrowser control within MFC applications, see Web Browser-Style Applications.
|
||||
//
|
||||
// The functionality of CXTHtmlView is designed for applications that access
|
||||
// the Web (and/or HTML documents). The following CXTHtmlView member functions
|
||||
// apply to the Internet Explorer application only. These functions will
|
||||
// succeed on the WebBrowser control, but they will have no visible effect.
|
||||
class _XT_EXT_CLASS CXTHtmlView : public CFormView
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTHtmlView)
|
||||
DECLARE_EVENTSINK_MAP()
|
||||
|
||||
protected:
|
||||
|
||||
// Summary: Constructs a CXTHtmlView object.
|
||||
CXTHtmlView();
|
||||
|
||||
// Summary: Destroys a CXTHtmlView object, handles cleanup and de-allocation.
|
||||
virtual ~CXTHtmlView();
|
||||
|
||||
bool m_bLoading; // true when loading the browser.
|
||||
bool m_bLoadingMessage; // true to display a loading message while a page is updating.
|
||||
CString m_strLoading; // Loading message string.
|
||||
IWebBrowser2* m_pBrowserApp; // Points to the IWebBrowser2 object associated with this view.
|
||||
|
||||
public:
|
||||
|
||||
CWnd m_wndBrowser; // CWnd object that represents the internet browser control associated with this view.
|
||||
|
||||
// Returns: A CString object containing the type name of the contained active document.
|
||||
// Summary: Call this member function to retrieve the type name of the contained
|
||||
// active document. Applies to Internet Explorer and WebBrowser.
|
||||
CString GetType() const;
|
||||
|
||||
// Returns: The left-edge distance, in pixels.
|
||||
// Summary: Call this member function to retrieve the distance between the internal
|
||||
// left edge of the WebBrowser control and the left edge of its container.
|
||||
// Applies to Internet Explorer and WebBrowser.
|
||||
long GetLeft() const;
|
||||
|
||||
// Input: nNewValue - The screen coordinate of the left edge of the main window.
|
||||
// Summary: Call this member function to set the horizontal position of the Internet
|
||||
// Explorer main window.
|
||||
void SetLeft(long nNewValue);
|
||||
|
||||
// Returns: The address of a variable that receives the screen coordinate of the main
|
||||
// window's top edge.
|
||||
// Summary: Call this member function to retrieve the screen coordinate of the
|
||||
// top edge of the WebBrowser control<6F>s main window. Applies to Internet
|
||||
// Explorer and WebBrowser.
|
||||
long GetTop() const;
|
||||
|
||||
// Input: nNewValue - The screen coordinate of the top edge of the main window.
|
||||
// Summary: Call this member function to set the distance between the internal top edge
|
||||
// of the WebBrowser control and the top edge of its container. Applies to
|
||||
// Internet Explorer and WebBrowser.
|
||||
void SetTop(long nNewValue);
|
||||
|
||||
// Returns: The control<6F>s frame window height, in pixels.
|
||||
// Summary: Call this member function to retrieve the height, in pixels, of the
|
||||
// WebBrowser control<6F>s frame window.
|
||||
long GetHeight() const;
|
||||
|
||||
// Input: nNewValue - The height, in pixels, of the main window.
|
||||
// Summary: Call this member function to set the height of the Internet Explorer
|
||||
// main window. Applies to Internet Explorer and WebBrowser.
|
||||
void SetHeight(long nNewValue);
|
||||
|
||||
// Input: bNewValue - Nonzero if the control is visible, otherwise zero.
|
||||
// Summary: Call this member function to set the visibility state of the WebBrowser
|
||||
// control. Applies to Internet Explorer and WebBrowser.
|
||||
void SetVisible(BOOL bNewValue);
|
||||
|
||||
// Returns: Nonzero if the object is visible, otherwise returns zero.
|
||||
// Summary: Call this member function to determine if the contained object is visible.
|
||||
// Applies to Internet Explorer and WebBrowser.
|
||||
BOOL GetVisible() const;
|
||||
|
||||
// Returns: A CString object containing the name of the resource currently
|
||||
// displayed in the WebBrowser.
|
||||
// Summary: Call this member function to get the name of the resource being displayed
|
||||
// in the WebBrowser. If the resource is an HTML page on the World Wide
|
||||
// Web, the name is the title of that page. If the resource is a folder
|
||||
// or file on the network or local computer, the name is the UNC or full
|
||||
// path of the folder or file. Applies to Internet Explorer and WebBrowser.
|
||||
CString GetLocationName() const;
|
||||
|
||||
// Returns: A READYSTATE value, as described in the Platform SDK.
|
||||
// Summary: Call this member function to retrieve the ready state of the WebBrowser
|
||||
// object. Applies to Internet Explorer and WebBrowser.
|
||||
READYSTATE GetReadyState() const;
|
||||
|
||||
// Returns: Nonzero if the web browser is currently offline, otherwise returns zero.
|
||||
// Summary: Call this member function to determine whether the web browser is operating
|
||||
// offline. Applies to Internet Explorer and WebBrowser.
|
||||
BOOL GetOffline() const;
|
||||
|
||||
// Input: bNewValue - Nonzero to read from the local cache, otherwise zero.
|
||||
// Summary: Call this member function to set a value indicating whether the WebBrowser
|
||||
// control is currently operating in offline mode. In offline mode, the
|
||||
// browser reads HTML pages from the local cache rather than from the
|
||||
// source document. Applies to Internet Explorer and WebBrowser.
|
||||
void SetOffline(BOOL bNewValue);
|
||||
|
||||
// Returns: Nonzero if dialog boxes cannot be displayed from
|
||||
// the WebBrowser control, otherwise returns zero.
|
||||
// Summary: Call this member function to determine whether any dialog boxes can
|
||||
// be shown in the WebBrowser control. Applies to Internet Explorer and
|
||||
// WebBrowser.
|
||||
BOOL GetSilent() const;
|
||||
|
||||
// Input: bNewValue - If nonzero, dialog boxes will not be displayed. If zero, dialog boxes
|
||||
// will be displayed. The default value is zero.
|
||||
// Summary: Call this member function to set a value indicating whether any dialog
|
||||
// boxes can be shown. Applies to Internet Explorer and WebBrowser.
|
||||
void SetSilent(BOOL bNewValue);
|
||||
|
||||
// Returns: Nonzero if the container is the top-level container, otherwise returns zero.
|
||||
// Summary: Call this member function to determine whether Internet Explorer is
|
||||
// the top-level container of the WebBrowser control. Applies to Internet
|
||||
// Explorer and WebBrowser.
|
||||
BOOL GetTopLevelContainer() const;
|
||||
|
||||
// Returns: A CString object containing the URL of the resource currently displayed in
|
||||
// the WebBrowser.
|
||||
// Summary: Call this member function to retrieve the URL of the resource that
|
||||
// the WebBrowser control is currently displaying. If the resource is
|
||||
// a folder or file on the network or local computer, the name is the
|
||||
// UNC or full path of the folder or file. Applies to Internet Explorer
|
||||
// and WebBrowser.
|
||||
CString GetLocationURL() const;
|
||||
|
||||
// Returns: Nonzero if the web browser is busy, otherwise returns zero.
|
||||
// Summary: Call this member function to determine whether the WebBrowser control
|
||||
// is engaged in a navigation or downloading operation. Applies to Internet
|
||||
// Explorer and WebBrowser.
|
||||
BOOL GetBusy() const;
|
||||
|
||||
// Returns: A pointer to the IDispatch interface of the active document object.
|
||||
// Summary: Call this member function to retrieve the automation object supported
|
||||
// by the application that contains the WebBrowser control. Applies to
|
||||
// Internet Explorer and WebBrowser.
|
||||
LPDISPATCH GetApplication() const;
|
||||
|
||||
// Returns: A pointer to the IDispatch interface of the object that is
|
||||
// the parent of the WebBrowser control.
|
||||
// Summary: Call this member function to retrieve a pointer to the parent object
|
||||
// of the WebBrowser control. Applies to Internet Explorer and WebBrowser.
|
||||
LPDISPATCH GetParentBrowser() const;
|
||||
|
||||
// Returns: A pointer to the IDispatch interface of the active document object.
|
||||
// Summary: Call this member function to retrieve an object that points to the
|
||||
// container of the web browser. Applies to Internet Explorer and WebBrowser.
|
||||
LPDISPATCH GetContainer() const;
|
||||
|
||||
// Returns: A pointer to the IDispatch interface of the active document object.
|
||||
// Summary: Call this member function to retrieve the HTML document for the active
|
||||
// document. Applies to Internet Explorer and WebBrowser.
|
||||
LPDISPATCH GetHtmlDocument() const;
|
||||
|
||||
// Returns: A CString object containing the path and name of the currently displayed
|
||||
// file. If no path and filename exist, GetFullName returns an empty CString.
|
||||
// Summary: Call this member function to retrieve the full path of the file that
|
||||
// Internet Explorer is currently displaying. Applies to Internet Explorer.
|
||||
// If you use this call with a WebBrowser control, it will return no error,
|
||||
// but it will ignore this call.
|
||||
CString GetFullName() const;
|
||||
|
||||
// Returns: A value indicating whether the toolbar is visible. Nonzero
|
||||
// if the toolbar is visible, otherwise zero.
|
||||
// Summary: Call this member function to determine whether the toolbar is visible.
|
||||
int GetToolBar() const;
|
||||
|
||||
// Input: nNewValue - Indicates whether to display the toolbar. Nonzero if the toolbar
|
||||
// is to be displayed, otherwise zero.
|
||||
// Summary: Call this member function to show or hide the Internet Explorer toolbar.
|
||||
// Applies to Internet Explorer. If you use this call with a WebBrowser
|
||||
// control, it will not return an error, but it will ignore this call.
|
||||
void SetToolBar(int nNewValue);
|
||||
|
||||
// Returns: Nonzero if the menu bar is visible, otherwise returns zero.
|
||||
// Summary: Call this member function to determine whether the menu bar is visible.
|
||||
// Applies to Internet Explorer and WebBrowser.
|
||||
BOOL GetMenuBar() const;
|
||||
|
||||
// Input: bNewValue - Nonzero to show the menu bar, otherwise zero.
|
||||
// Summary: Call this member function to show or hide the Internet Explorer menu bar.
|
||||
// Applies to Internet Explorer. If you use this call with a WebBrowser
|
||||
// control, it will not return an error, but it will ignore this call.
|
||||
void SetMenuBar(BOOL bNewValue);
|
||||
|
||||
// Returns: Nonzero if the WebBrowser is operating in full-screen mode, otherwise
|
||||
// returns zero.
|
||||
// Summary: Call this member function to determine whether the WebBrowser control
|
||||
// is operating in full-screen mode or in normal window mode. In full-screen
|
||||
// mode, the Internet Explorer main window is maximized and the status
|
||||
// bar, toolbar, menu bar, and title bar are hidden. Applies to Internet
|
||||
// Explorer and WebBrowser.
|
||||
BOOL GetFullScreen() const;
|
||||
|
||||
// Input: bNewValue - Nonzero for full-screen mode, otherwise zero.
|
||||
// Summary: Call this member function to set Internet Explorer to either full-screen
|
||||
// or normal window mode. In full-screen mode, the Internet Explorer
|
||||
// main window is maximized and the status bar, toolbar, menu bar, and
|
||||
// title bar are hidden. Applies to Internet Explorer. If you use this
|
||||
// call with a WebBrowser control, it will not return an error, but it will
|
||||
// ignore this call.
|
||||
void SetFullScreen(BOOL bNewValue);
|
||||
|
||||
// Input: cmdID - The OLECMDID value of the command for which the caller needs status
|
||||
// information.
|
||||
// Returns: The address of the OLECMDF value that receives the status of the command.
|
||||
// Summary: Call this member function to query a command status. QueryStatusWB
|
||||
// implements the behavior of the IOleCommandTarget::QueryStatus method.
|
||||
// Applies to Internet Explorer and WebBrowser.
|
||||
OLECMDF QueryStatusWB(OLECMDID cmdID) const;
|
||||
|
||||
// Returns: Nonzero if the browser is registered as a top-level browser, otherwise
|
||||
// returns zero.
|
||||
// Summary: Call this member function to determine whether the WebBrowser object
|
||||
// is registered as a top-level browser for target name resolution. Applies
|
||||
// to Internet Explorer and WebBrowser.
|
||||
BOOL GetRegisterAsBrowser() const;
|
||||
|
||||
// Input: bNewValue - Determines whether Internet Explorer is registered as a top-level
|
||||
// browser. If nonzero, the web browser is registered as a top-level
|
||||
// browser. If zero, it is not a top-level browser. The default value
|
||||
// is zero.
|
||||
// Summary: Call this member function to set a value indicating whether the WebBrowser
|
||||
// control is registered as a top-level browser for target name resolution.
|
||||
// A top-level browser is the browser set in the registry as the default
|
||||
// browser. Applies to Internet Explorer and WebBrowser.
|
||||
void SetRegisterAsBrowser(BOOL bNewValue);
|
||||
|
||||
// Returns: Nonzero if the browser is registered as a drop target, otherwise returns zero.
|
||||
// Summary: Call this member function to determine whether the WebBrowser control
|
||||
// is registered as a drop target for navigation. Applies to Internet
|
||||
// Explorer and WebBrowser.
|
||||
BOOL GetRegisterAsDropTarget() const;
|
||||
|
||||
// Input: bNewValue - Determines if the WebBrowser control is registered as a drop target
|
||||
// for navigation. If nonzero, the object is registered as a drop target.
|
||||
// If zero, it is not a drop target.
|
||||
// Summary: Call this member function to set a value indicating whether the WebBrowser
|
||||
// control is registered as a drop target for navigation. Applies to
|
||||
// Internet Explorer and WebBrowser.
|
||||
void SetRegisterAsDropTarget(BOOL bNewValue);
|
||||
|
||||
// Returns: Nonzero if the web browser is in theater mode, otherwise returns zero.
|
||||
// Summary: Call this member function to determine whether the web browser is in
|
||||
// theater mode. When the web browser is in theater mode, the browser
|
||||
// main window fills the entire screen, a toolbar with a minimal set of
|
||||
// navigational tools appears, and the status bar appears in the upper
|
||||
// right-hand corner of the screen. Applies to Internet Explorer and
|
||||
// WebBrowser.
|
||||
BOOL GetTheaterMode() const;
|
||||
|
||||
// Input: bNewValue - Nonzero to set the WebBrowser control to theater mode, otherwise zero.
|
||||
// The default value is zero.
|
||||
// Summary: Call this member function to set a value indicating whether the WebBrowser
|
||||
// control is in theater mode. When the web browser is in theater mode,
|
||||
// the browser main window fills the entire screen, a toolbar with a minimal
|
||||
// set of navigational tools appears, and the status bar appears in the
|
||||
// upper right-hand corner of the screen. Applies to Internet Explorer
|
||||
// and WebBrowser.
|
||||
void SetTheaterMode(BOOL bNewValue);
|
||||
|
||||
// Returns: Nonzero if the address bar is visible, otherwise returns zero.
|
||||
// Summary: Call this member function to retrieve Internet Explorer<65>s address bar.
|
||||
// Applies to Internet Explorer. If you use this call with a WebBrowser
|
||||
// control, it will return no error, but it will ignore this call.
|
||||
BOOL GetAddressBar() const;
|
||||
|
||||
// Input: bNewValue - Nonzero to show address bar, otherwise zero.
|
||||
// Summary: Call this member function to show or hide the Internet Explorer object's
|
||||
// address bar. Applies to Internet Explorer. If you use this call with
|
||||
// a WebBrowser control, it will return no error, but it will ignore this
|
||||
// call.
|
||||
void SetAddressBar(BOOL bNewValue);
|
||||
|
||||
// Returns: Nonzero if the status bar can be displayed, otherwise returns zero.
|
||||
// Summary: Call this member function to determine whether the WebBrowser control
|
||||
// displays a status bar. Applies to Internet Explorer. If you use this
|
||||
// call with a WebBrowser control, it will return no error, but it will
|
||||
// ignore this call.
|
||||
BOOL GetStatusBar() const;
|
||||
|
||||
// Input: bNewValue - Nonzero if the status bar is visible, otherwise zero.
|
||||
// Summary: Call this member function to display the status bar. Applies to Internet
|
||||
// Explorer. If you use this call with a WebBrowser control, it will
|
||||
// return no error, but it will ignore this call.
|
||||
void SetStatusBar(BOOL bNewValue);
|
||||
|
||||
// Summary: This member function navigates backward one item in the history list.
|
||||
// Applies to Internet Explorer and WebBrowser.
|
||||
void GoBack();
|
||||
|
||||
// Summary: This member function navigates forward one item in the history list.
|
||||
// Applies to Internet Explorer and WebBrowser.
|
||||
void GoForward();
|
||||
|
||||
// Summary: This member function navigates to the current home or start page specified
|
||||
// in the Internet Explorer Internet Options dialog box or the Internet
|
||||
// Properties dialog box, accessed from the Control Panel. Applies to
|
||||
// Internet Explorer and WebBrowser.
|
||||
void GoHome();
|
||||
|
||||
// Summary: This member function navigates to the current search page, as specified
|
||||
// in the Internet Explorer Internet Options dialog box or the Internet
|
||||
// Properties dialog box, accessed from the Control Panel. Applies to
|
||||
// Internet Explorer and WebBrowser.
|
||||
void GoSearch();
|
||||
|
||||
// Input: URL - A caller-allocated string that contains the URL to navigate to, or
|
||||
// the full path of the file to display.
|
||||
// dwFlags - The flags of a variable that specifies whether to add the resource
|
||||
// to the history list, whether to read to or write from the cache, and
|
||||
// whether to display the resource in a new window. The variable can
|
||||
// be a combination of the values defined by the BrowserNavConstants
|
||||
// enumeration.
|
||||
// lpszTargetFrameName - A pointer to a string that contains the name of the frame in which
|
||||
// to display the resource.
|
||||
// lpszHeaders - A pointer to a value that specifies the HTTP headers to send to the
|
||||
// server. These headers are added to the default Internet Explorer
|
||||
// headers. The headers can specify such things as the action required
|
||||
// of the server, the type of data being passed to the server, or a status
|
||||
// code. This parameter is ignored if the URL is not an HTTP URL.
|
||||
// lpvPostData - A pointer to the data to send with the HTTP POST transaction. For
|
||||
// example, the POST transaction is used to send data gathered by an
|
||||
// HTML form. If this parameter does not specify any post data, Navigate
|
||||
// issues an HTTP GET transaction. This parameter is ignored if the URL
|
||||
// is not an HTTP URL.
|
||||
// dwPostDataLen - Data to send with the HTTP POST transaction. For example, the POST
|
||||
// transaction is used to send data gathered by an HTML form. If this
|
||||
// parameter does not specify any post data, Navigate issues an HTTP
|
||||
// GET transaction. This parameter is ignored if the URL is not an HTTP URL.
|
||||
// Summary: Call this member function to navigate to the resource identified by
|
||||
// a URL. Applies to Internet Explorer and WebBrowser.
|
||||
void Navigate(LPCTSTR URL,DWORD dwFlags = 0,LPCTSTR lpszTargetFrameName = NULL,LPCTSTR lpszHeaders = NULL,LPVOID lpvPostData = NULL, DWORD dwPostDataLen = 0);
|
||||
|
||||
// Input: pIDL - A pointer to an ITEMIDLIST structure.
|
||||
// dwFlags - The flags of a variable that specifies whether to add the resource
|
||||
// to the history list, whether to read to or write from the cache, and
|
||||
// whether to display the resource in a new window. The variable can
|
||||
// be a combination of the values defined by the BrowserNavConstants
|
||||
// enumeration.
|
||||
// lpszTargetFrameName - A pointer to a string that contains the name of the frame in which
|
||||
// to display the resource.
|
||||
// Summary: Call this member function to navigate to the resource identified by
|
||||
// a URL, or to the file identified by a full path. This member function
|
||||
// extends the Navigate member function by supporting browsing on special
|
||||
// folders, such as Desktop and My Computer, that are represented by the
|
||||
// parameter 'pIDL'. Applies to Internet Explorer and WebBrowser.
|
||||
void Navigate2(LPITEMIDLIST pIDL,DWORD dwFlags = 0,LPCTSTR lpszTargetFrameName = NULL);
|
||||
|
||||
// Input: lpszURL - A pointer to a string containing the URL.
|
||||
// dwFlags - The flags of a variable that specifies whether to add the resource
|
||||
// to the history list, whether to read to or write from the cache, and
|
||||
// whether to display the resource in a new window. The variable can
|
||||
// be a combination of the values defined by the BrowserNavConstants
|
||||
// enumeration.
|
||||
// lpszTargetFrameName - A pointer to a string that contains the name of the frame in which
|
||||
// to display the resource.
|
||||
// lpszHeaders - A pointer to a value that specifies the HTTP headers to send to the
|
||||
// server. These headers are added to the default Internet Explorer headers.
|
||||
// The headers can specify such things as the action required of the
|
||||
// server, the type of data being passed to the server, or a status code.
|
||||
// This parameter is ignored if the URL is not an HTTP URL.
|
||||
// lpvPostData - Data to send with the HTTP POST transaction. For example, the POST
|
||||
// transaction is used to send data gathered by an HTML form. If this
|
||||
// parameter does not specify any post data, Navigate2 issues an HTTP
|
||||
// GET transaction. This parameter is ignored if the URL is not an HTTP URL.
|
||||
// dwPostDataLen - Length in bytes of the data pointed to by the 'lpvPostData' parameter.
|
||||
// Summary: Call this member function to navigate to the resource identified by
|
||||
// a URL, or to the file identified by a full path. This member function
|
||||
// extends the Navigate member function by supporting browsing on special
|
||||
// folders, such as Desktop and My Computer, that are represented by the
|
||||
// parameter 'pIDL'. Applies to Internet Explorer and WebBrowser.
|
||||
void Navigate2(LPCTSTR lpszURL, DWORD dwFlags = 0, LPCTSTR lpszTargetFrameName = NULL, LPCTSTR lpszHeaders = NULL, LPVOID lpvPostData = NULL, DWORD dwPostDataLen = 0);
|
||||
|
||||
// Input: lpszURL - A pointer to a string containing the URL.
|
||||
// dwFlags - A pointer to a string that contains the name of the frame in which
|
||||
// to display the resource.
|
||||
// baPostedData - A reference to a CByteArray object.
|
||||
// lpszTargetFrameName - A pointer to a string that contains the name of the frame in which
|
||||
// to display the resource.
|
||||
// lpszHeader - A pointer to a value that specifies the HTTP headers to send to the
|
||||
// server. These headers are added to the default Internet Explorer headers.
|
||||
// The headers can specify such things as the action required of the
|
||||
// server, the type of data being passed to the server, or a status code.
|
||||
// This parameter is ignored if the URL is not an HTTP URL.
|
||||
// Summary: Call this member function to navigate to the resource identified by
|
||||
// a URL, or to the file identified by a full path. This member function
|
||||
// extends the Navigate member function by supporting browsing on special
|
||||
// folders, such as Desktop and My Computer, that are represented by the
|
||||
// parameter 'pIDL'. Applies to Internet Explorer and WebBrowser.
|
||||
void Navigate2(LPCTSTR lpszURL, DWORD dwFlags, CByteArray& baPostedData, LPCTSTR lpszTargetFrameName = NULL, LPCTSTR lpszHeader = NULL);
|
||||
|
||||
// Summary: This member function reloads the URL or file that the web browser is
|
||||
// currently displaying. Refresh contains no parameters for setting the
|
||||
// refresh level. Applies to Internet Explorer and WebBrowser.
|
||||
void Refresh();
|
||||
|
||||
// Input: nLevel - The address of the variable specifying the refresh level. The possible
|
||||
// variables are defined in RefreshConstants, in the Platform SDK.
|
||||
// Summary: This member function reloads the file that Internet Explorer is currently
|
||||
// displaying. Unlike Refresh, Refresh2 contains a parameter that specifies
|
||||
// the refresh level. Applies to Internet Explorer and WebBrowser.
|
||||
void Refresh2(int nLevel);
|
||||
|
||||
// Summary: Call this member function to cancel any pending navigation or download
|
||||
// operation and stop any dynamic page elements, such as background sounds
|
||||
// and animations. Applies to Internet Explorer and WebBrowser.
|
||||
void Stop();
|
||||
|
||||
// Input: lpszProperty - A string containing the property to set.
|
||||
// vtValue - The new value of the property indicated by 'lpszProperty'.
|
||||
// Summary: Call this member function to set the property associated with a given
|
||||
// object. Applies to Internet Explorer and WebBrowser.
|
||||
void PutProperty(LPCTSTR lpszProperty, const VARIANT& vtValue);
|
||||
|
||||
// Input: lpszPropertyName - A pointer to a string containing the name of the property to set.
|
||||
// dValue - The new value of the property.
|
||||
// Summary: Call this member function to set the property associated with a given
|
||||
// object. Applies to Internet Explorer and WebBrowser.
|
||||
void PutProperty(LPCTSTR lpszPropertyName, double dValue);
|
||||
|
||||
// Input: lpszPropertyName - A pointer to a string containing the name of the property to set.
|
||||
// lpszValue - A pointer to a string containing the new value of the property.
|
||||
// Summary: Call this member function to set the property associated with a given
|
||||
// object. Applies to Internet Explorer and WebBrowser.
|
||||
void PutProperty(LPCTSTR lpszPropertyName, LPCTSTR lpszValue);
|
||||
|
||||
// Input: lpszPropertyName - A pointer to a string containing the name of the property to set.
|
||||
// lValue - The new value of the property.
|
||||
// Summary: Call this member function to set the property associated with a given
|
||||
// object. Applies to Internet Explorer and WebBrowser.
|
||||
void PutProperty(LPCTSTR lpszPropertyName, long lValue);
|
||||
|
||||
// Input: lpszPropertyName - A pointer to a string containing the name of the property to set.
|
||||
// nValue - The new value of the property.
|
||||
// Summary: Call this member function to set the property associated with a given
|
||||
// object. Applies to Internet Explorer and WebBrowser.
|
||||
void PutProperty(LPCTSTR lpszPropertyName, short nValue);
|
||||
|
||||
// Input: lpszProperty - A pointer to a string containing the property to retrieve.
|
||||
// strValue - A reference to a CString object that receives the current value of
|
||||
// the property.
|
||||
// Returns: Nonzero if completed successfully, otherwise returns zero.
|
||||
// Summary: Call this member function to get the value of the property currently
|
||||
// associated with the control. Applies to Internet Explorer and WebBrowser.
|
||||
BOOL GetProperty(LPCTSTR lpszProperty, CString& strValue);
|
||||
|
||||
// Input: lpszProperty - A pointer to a string containing the property to retrieve.
|
||||
// Returns: A COleVariant object.
|
||||
// Summary: Call this member function to get the value of the property currently
|
||||
// associated with the control. Applies to Internet Explorer and WebBrowser.
|
||||
COleVariant GetProperty(LPCTSTR lpszProperty);
|
||||
|
||||
// Input: cmdID - The command to execute.
|
||||
// cmdexecopt - The options set for executing the command.
|
||||
// pvaIn - A variant used for specifying the command input arguments.
|
||||
// pvaOut - A variant used for specifying the command output arguments.
|
||||
// Summary: Call this member function to execute a command in the WebBrowser or
|
||||
// Internet Explorer. See IWebBrowser2::ExecWB in the Platform SDK.
|
||||
void ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, VARIANT* pvaIn, VARIANT* pvaOut);
|
||||
|
||||
// Input: lpszResource - A pointer to a string containing the name of the resource to load.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to load the specified resource into the WebBrowser
|
||||
// control. Applies to Internet Explorer and WebBrowser.
|
||||
BOOL LoadFromResource(LPCTSTR lpszResource);
|
||||
|
||||
// Input: nRes - The ID of the buffer containing the name of the resource to load.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to load the specified resource into the WebBrowser
|
||||
// control. Applies to Internet Explorer and WebBrowser.
|
||||
BOOL LoadFromResource(UINT nRes);
|
||||
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValid() const;
|
||||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
|
||||
// Input: pDC - A pointer to the device context to be used for rendering an image.
|
||||
// Summary: This member function is called by the framework to draw the view.
|
||||
// Applies to Internet Explorer and WebBrowser.
|
||||
virtual void OnDraw(CDC* pDC);
|
||||
|
||||
// Input: lpszClassName - Points to a null-terminated character string that names the Windows
|
||||
// class. The class name can be any name registered with the
|
||||
// AfxRegisterWndClass global function or the RegisterClass Windows function.
|
||||
// If NULL, it uses the predefined default CFrameWnd attributes.
|
||||
// lpszWindowName - Points to a null-terminated character string that represents the window's
|
||||
// name.
|
||||
// dwStyle - Specifies the window style attributes. By default, the WS_VISIBLE
|
||||
// and WS_CHILD Windows styles are set.
|
||||
// rect - A reference to a RECT structure specifying the size and position of
|
||||
// the window. The rectDefault value allows Windows to specify the size
|
||||
// and position of the new window.
|
||||
// pParentWnd - A pointer to the parent window of the control.
|
||||
// nID - The ID number of the view. By default, set to AFX_IDW_PANE_FIRST.
|
||||
// pContext - A pointer to a CCreateContext. It is NULL by default.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to create a WebBrowser control or container
|
||||
// for the Internet Explorer executable.
|
||||
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
|
||||
|
||||
// Input: strURL - A string expression that evaluates to the URL, UNC file name, or PIDL (a
|
||||
// pointer to an item identifier list) that was navigated to.
|
||||
// Summary: This member function is called by the framework after a navigation
|
||||
// to a hyperlink completes (on either a window or frameset element).
|
||||
// The URL parameter can be a PIDL in the case of a shell name space entity
|
||||
// for which there is no URL representation. Note that the URL contained
|
||||
// in 'strURL' can be different from the URL that the browser was told to
|
||||
// navigate to, because this URL is the canonicalized and qualified URL.
|
||||
// For example, if an application specifies a URL of "www.microsoft.com"
|
||||
// in a call to Navigate or Navigate2, the URL passed by OnNavigateComplete2
|
||||
// will be "http://www.microsoft.com/". Also, if the server has redirected
|
||||
// the browser to a different URL, the redirected URL will be reflected
|
||||
// here.
|
||||
virtual void OnNavigateComplete2(LPCTSTR strURL);
|
||||
|
||||
// Input: lpszURL - Pointer to a string containing the URL to navigate to.
|
||||
// nFlags - Reserved for future use.
|
||||
// lpszTargetFrameName - A string that contains the name of the frame in which to display the
|
||||
// resource, or NULL if no named frame is targeted for the resource.
|
||||
// baPostedData - A reference to a CByteArray object containing the data to send to
|
||||
// the server if the HTTP POST transaction is being used.
|
||||
// lpszHeaders - A pointer to a string containing additional HTTP headers to send to
|
||||
// the server (HTTP URLs only). The headers can specify such things
|
||||
// as the action required of the server, the type of data being passed
|
||||
// to the server, or a status code.
|
||||
// pbCancel - A pointer to a cancel flag. An application can set this parameter
|
||||
// to nonzero to cancel the navigation operation, or to zero to allow
|
||||
// it to proceed.
|
||||
// Summary: This member function is called by the framework to cause an event to fire
|
||||
// before a navigation occurs in the web browser.
|
||||
virtual void OnBeforeNavigate2(LPCTSTR lpszURL, DWORD nFlags, LPCTSTR lpszTargetFrameName, CByteArray& baPostedData, LPCTSTR lpszHeaders, BOOL* pbCancel);
|
||||
|
||||
// Input: lpszText - A string that contains the new status bar text.
|
||||
// Summary: This member function is called by the framework to notify an application
|
||||
// that the text of the status bar associated with the WebBrowser control
|
||||
// has changed.
|
||||
virtual void OnStatusTextChange(LPCTSTR lpszText);
|
||||
|
||||
// Input: nProgress - Amount of total progress to show, or -1 when progress is complete.
|
||||
// nProgressMax - Maximum progress value.
|
||||
// Summary: This member function is called by the framework to notify an application
|
||||
// that the progress of a download operation has been updated. The container
|
||||
// can use the information provided by this event to display the number
|
||||
// of bytes downloaded so far or to update a progress indicator.
|
||||
virtual void OnProgressChange(long nProgress, long nProgressMax);
|
||||
|
||||
// Input: nCommand - Identifier of the command whose enabled state has changed.
|
||||
// bEnable - Enabled state. This parameter is nonzero if the command is enabled,
|
||||
// or zero if it is disabled.
|
||||
// Summary: This member function is called by the framework to notify an application
|
||||
// that the enabled state of a web browser command has changed.
|
||||
virtual void OnCommandStateChange(long nCommand, BOOL bEnable);
|
||||
|
||||
// Summary: This member function is called by the framework to begin downloading
|
||||
// a document. This event is fired shortly after the OnBeforeNavigate2
|
||||
// event, unless the navigation is canceled. Any animation or "busy"
|
||||
// indication that the container needs to display should be connected
|
||||
// to this event.
|
||||
virtual void OnDownloadBegin();
|
||||
|
||||
// Summary: This member function is called by the framework to indicate that a
|
||||
// navigation operation finished, was halted, or failed.
|
||||
virtual void OnDownloadComplete();
|
||||
|
||||
// Input: lpszText - The new document title.
|
||||
// Summary: This member function is called by the framework to notify an application
|
||||
// if the title of a document in the WebBrowser control becomes available
|
||||
// or changes. For HTML, the title might change. While HTML is still
|
||||
// downloading, the URL of the document is set as the title. After the
|
||||
// real title (if there is one) is parsed from the HTML, the title is
|
||||
// changed to reflect the actual title.
|
||||
virtual void OnTitleChange(LPCTSTR lpszText);
|
||||
|
||||
// Input: lpszProperty - A pointer to a string containing the name of the property.
|
||||
// Summary: This member function is called by the framework to notify an application
|
||||
// that PutProperty has changed the value of a property.
|
||||
virtual void OnPropertyChange(LPCTSTR lpszProperty);
|
||||
|
||||
// Input: ppDisp - A pointer to an interface pointer that, optionally, receives the
|
||||
// IDispatch interface pointer of a new WebBrowser or Internet Explorer
|
||||
// object.
|
||||
// Cancel - A pointer to a cancel flag. An application can set this parameter
|
||||
// to nonzero to cancel the navigation operation, or to zero to allow
|
||||
// it to proceed.
|
||||
// Summary: This member function is called by the framework when a new window is
|
||||
// to be created for displaying a resource. This event precedes the creation
|
||||
// of a new window from within the WebBrowser.
|
||||
virtual void OnNewWindow2(LPDISPATCH* ppDisp, BOOL* Cancel);
|
||||
|
||||
// Input: lpszURL - A pointer to a string that evaluates to the URL, UNC file name, or
|
||||
// a PIDL (a pointer to an item identifier list) that was navigated to.
|
||||
// Summary: This member function is called by the framework to notify an application
|
||||
// that a document has reached the READYSTATE_COMPLETE state. Not every
|
||||
// frame will fire this event, but each frame that fires an OnDownloadBegin
|
||||
// event will fire a corresponding OnDocumentComplete event. The URL
|
||||
// indicated by 'lpszURL' can be different from the URL that the browser
|
||||
// was told to navigate to, because this URL is the canonicalized and
|
||||
// qualified URL. For example, if an application specifies a URL of
|
||||
// "www.microsoft.com" in a call to Navigate or Navigate2, the URL passed
|
||||
// by OnNavigateComplete2 will be "http://www.microsoft.com/". Also, if
|
||||
// the server has redirected the browser to a different URL, the redirected
|
||||
// URL will be reflected here.
|
||||
virtual void OnDocumentComplete(LPCTSTR lpszURL);
|
||||
|
||||
// Summary: This member function is called by the framework to notify an application
|
||||
// that the Internet Explorer application is ready to quit.
|
||||
virtual void OnQuit();
|
||||
|
||||
// Input: bVisible - Nonzero if the object is visible or zero otherwise.
|
||||
// Summary: This member function is called by the framework when the window for
|
||||
// the WebBrowser should be shown or hidden. This allows the object control
|
||||
// host window to behave the same way the Internet Explorer window would
|
||||
// behave.
|
||||
virtual void OnVisible(BOOL bVisible);
|
||||
|
||||
// Input: bToolBar - Nonzero if Internet Explorer's toolbar is visible or zero otherwise.
|
||||
// Summary: This member function is called by the framework when the ToolBar property
|
||||
// has changed.
|
||||
virtual void OnToolBar(BOOL bToolBar);
|
||||
|
||||
// Input: bMenuBar - Nonzero if the Internet Explorer menu bar is visible or zero otherwise.
|
||||
// Summary: This member function is called by the framework when the MenuBar property
|
||||
// has changed.
|
||||
virtual void OnMenuBar(BOOL bMenuBar);
|
||||
|
||||
// Input: bStatusBar - Nonzero if Internet Explorer's status bar is visible or zero otherwise.
|
||||
// Summary: This member function is called by the framework when the StatusBar property
|
||||
// has changed.
|
||||
virtual void OnStatusBar(BOOL bStatusBar);
|
||||
|
||||
// Input: bFullScreen - Nonzero if Internet Explorer is in full screen mode or zero otherwise.
|
||||
// Summary: This member function is called by the framework when the FullScreen property
|
||||
// has changed.
|
||||
virtual void OnFullScreen(BOOL bFullScreen);
|
||||
|
||||
// Input: bTheaterMode - Nonzero if Internet Explorer is in theater mode or zero otherwise.
|
||||
// Summary: This member function is called by the framework when the TheaterMode property
|
||||
// has changed.
|
||||
virtual void OnTheaterMode(BOOL bTheaterMode);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTHtmlView)
|
||||
protected:
|
||||
virtual void NavigateComplete2(LPDISPATCH pDisp, VARIANT* URL);
|
||||
virtual void BeforeNavigate2(LPDISPATCH pDisp, VARIANT* URL, VARIANT* Flags, VARIANT* TargetFrameName, VARIANT* PostData, VARIANT* Headers, BOOL* Cancel);
|
||||
virtual void DocumentComplete(LPDISPATCH pDisp, VARIANT* URL);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTHtmlView)
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnFilePrint();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnPaint();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTHtmlView::SetRegisterAsBrowser(BOOL bNewValue) {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_RegisterAsBrowser((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE));
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::SetRegisterAsDropTarget(BOOL bNewValue) {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_RegisterAsDropTarget((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE));
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::SetTheaterMode(BOOL bNewValue) {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_TheaterMode((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE));
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::SetVisible(BOOL bNewValue) {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Visible((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE));
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::SetMenuBar(BOOL bNewValue) {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_MenuBar((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE));
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::SetToolBar(int nNewValue) {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_ToolBar(nNewValue);
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::SetOffline(BOOL bNewValue) {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Offline((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE));
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::SetSilent(BOOL bNewValue) {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Silent((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE));
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::GoBack() {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->GoBack();
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::GoForward() {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->GoForward();
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::GoHome() {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->GoHome();
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::GoSearch() {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->GoSearch();
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::Refresh() {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->Refresh();
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::Refresh2(int nLevel) {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->Refresh2(COleVariant((long) nLevel, VT_I4));
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::Stop() {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->Stop();
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::SetFullScreen(BOOL bNewValue) {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_FullScreen((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE));
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::SetAddressBar(BOOL bNewValue) {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_AddressBar((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE));
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::SetHeight(long nNewValue) {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Height(nNewValue);
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::PutProperty(LPCTSTR lpszPropertyName, long lValue) {
|
||||
ASSERT(m_pBrowserApp != NULL); ASSERT(m_pBrowserApp != NULL); PutProperty(lpszPropertyName, COleVariant(lValue, VT_UI4));
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::PutProperty(LPCTSTR lpszPropertyName, short nValue) {
|
||||
ASSERT(m_pBrowserApp != NULL); ASSERT(m_pBrowserApp != NULL); PutProperty(lpszPropertyName, COleVariant(nValue, VT_UI2));
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::PutProperty(LPCTSTR lpszPropertyName, LPCTSTR lpszValue) {
|
||||
ASSERT(m_pBrowserApp != NULL); ASSERT(m_pBrowserApp != NULL); PutProperty(lpszPropertyName, COleVariant(lpszValue, VT_BSTR));
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::PutProperty(LPCTSTR lpszPropertyName, double dValue) {
|
||||
ASSERT(m_pBrowserApp != NULL); ASSERT(m_pBrowserApp != NULL); PutProperty(lpszPropertyName, COleVariant(dValue));
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::SetTop(long nNewValue) {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Top(nNewValue);
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::SetLeft(long nNewValue) {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_Left(nNewValue);
|
||||
}
|
||||
AFX_INLINE void CXTHtmlView::SetStatusBar(BOOL bNewValue) {
|
||||
ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->put_StatusBar((short) (bNewValue ? AFX_OLE_TRUE : AFX_OLE_FALSE));
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTHTMLVIEW_H__)
|
||||
250
Editor/XT/Include/XTHyperLink.h
Normal file
250
Editor/XT/Include/XTHyperLink.h
Normal file
@@ -0,0 +1,250 @@
|
||||
// XTHyperLink.h interface for the CXTHyperLink class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTHYPERLINK_H__)
|
||||
#define __XTHYPERLINK_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTHyperLink is a CStatic derived class. It is used to display a text
|
||||
// string that is used as a hyperlink control. The link's active, hover,
|
||||
// and selected color attributes are configurable.
|
||||
class _XT_EXT_CLASS CXTHyperLink : public CStatic
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTHyperLink)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTHyperLink object.
|
||||
CXTHyperLink();
|
||||
|
||||
// Summary: Destroys a CXTHyperLink object, handles cleanup and de-allocation.
|
||||
virtual ~CXTHyperLink();
|
||||
|
||||
// Attributes
|
||||
protected:
|
||||
|
||||
bool m_bShellExec; // true to cause the hyperlink to call ShellExecute for the specified URL.
|
||||
bool m_bInitControl; // true for initialization.
|
||||
bool m_bUnderline; // Set to true for underlined text.
|
||||
bool m_bMouseOver; // Set to true when the cursor is hovering over the control.
|
||||
bool m_bVisited; // Set to true when the hyperlink has been activated.
|
||||
bool m_bTipEnabled; // Set to false to disable tooltips.
|
||||
CString m_strLink; // String object that represents the URL for this control.
|
||||
CString m_strTipText; // String object that represents the tooltip text for this control.
|
||||
HCURSOR m_hcurHand; // Handle to the default cursor for this control.
|
||||
COLORREF m_clrLink; // An RGB value representing the color for the hyperlink text color.
|
||||
COLORREF m_clrHover; // An RGB value representing the color for the hyperlink text color when the mouse is hovering.
|
||||
COLORREF m_clrVisited; // An RGB value representing the color for the hyperlink text color when the URL has been visited.
|
||||
COLORREF m_clrBack; // An RGB value representing the background fill color for the hyperlink control.
|
||||
CToolTipCtrl m_toolTip; // Tooltip to be displayed for the control.
|
||||
|
||||
public:
|
||||
|
||||
// Input: bEnable - true to enable ShellExecute, false to disable.
|
||||
// Summary: Call this member function to enable or disable ShellExecute to be called
|
||||
// for the URL that is specified for the hyperlink control. If disabled,
|
||||
// you can add a BN_CLICKED message handler to perform your own task when
|
||||
// the link is clicked.
|
||||
void EnableShellExecute(bool bEnable);
|
||||
|
||||
// Input: lpszLink - A NULL terminated character string that
|
||||
// represents the URL for the hyperlink.
|
||||
// Summary: This member function sets the URL for the hyperlink control.
|
||||
virtual void SetURL(LPCTSTR lpszLink);
|
||||
|
||||
// Returns: A CString object that represents the URL for the hyperlink control.
|
||||
// Summary: This member function retrieves the URL for the hyperlink.
|
||||
virtual CString GetURL() const;
|
||||
|
||||
// Input: clrLink - An RGB value representing the color for the hyperlink text color.
|
||||
// clrVisited - An RGB value representing the color for the hyperlink text color
|
||||
// when the mouse is hovering.
|
||||
// clrHover - An RGB value representing the color for the hyperlink text color
|
||||
// when the URL has been visited.
|
||||
// Summary: This member function will set the RGB color values for the hyperlink text.
|
||||
virtual void SetColors(COLORREF clrLink,COLORREF clrVisited,COLORREF clrHover);
|
||||
|
||||
// Returns: An RGB color value that represents the current hyperlink text color.
|
||||
// Summary: This member function retrieves the current hyperlink text color.
|
||||
virtual COLORREF GetLinkColor() const;
|
||||
|
||||
// Returns: An RGB color value that represents the current hyperlink text color when
|
||||
// the link has been activated.
|
||||
// Summary: This member function retrieves the current hyperlink text color
|
||||
// when the link has been activated.
|
||||
virtual COLORREF GetVisitedColor() const;
|
||||
|
||||
// Returns: An RGB color value that represents the current hyperlink text color when
|
||||
// the mouse hovers over the hyperlink.
|
||||
// Summary: This member function retrieves the current hyperlink text color
|
||||
// when the mouse hovers over the hyperlink.
|
||||
virtual COLORREF GetHoverColor() const;
|
||||
|
||||
// Input: bVisited - A boolean flag that, when set to true, causes the control to
|
||||
// display the hyperlink text color as visited.
|
||||
// Summary: This member function will cause the control to display the hyperlink
|
||||
// text color as visited.
|
||||
virtual void SetVisited(bool bVisited = true);
|
||||
|
||||
// Returns: true if the URL has been visited, otherwise returns false.
|
||||
// Summary: This member function checks to see if the user has visited the URL
|
||||
// associated with the hyperlink.
|
||||
virtual bool GetVisited() const;
|
||||
|
||||
// Input: hCursor - Handle of the cursor to be associated with the hyperlink control.
|
||||
// Summary: This member function will set the cursor to be displayed when the
|
||||
// mouse hovers over the hyperlink control.
|
||||
virtual void SetLinkCursor(HCURSOR hCursor);
|
||||
|
||||
// Returns: A handle to the current cursor for the hyperlink control.
|
||||
// Summary: This member function will get a handle to the current cursor associated
|
||||
// with the hyperlink control.
|
||||
virtual HCURSOR GetLinkCursor() const;
|
||||
|
||||
// Input: bUnderline - A boolean flag that, when set to true, causes the control to
|
||||
// display the text as underlined.
|
||||
// Summary: This member function will cause the hyperlink to display the text
|
||||
// as underlined. The default value is 'true.'
|
||||
virtual void SetUnderline(bool bUnderline = true);
|
||||
|
||||
// Returns: true if the hyperlink text is underlined, otherwise returns false.
|
||||
// Summary: This member function checks to see if the hyperlink text is underlined.
|
||||
virtual bool GetUnderline() const;
|
||||
|
||||
// Input: clrBack - An RGB value representing the background fill color.
|
||||
// Summary: This member function will set the background fill color for the hyperlink
|
||||
// control. By default the hyperlink control uses the system color for COLOR_3DFACE.
|
||||
virtual void SetBackColor(COLORREF clrBack);
|
||||
|
||||
// Returns: A COLOREF value.
|
||||
// Summary: This member function will return the current background fill color for the
|
||||
// hyperlink control.
|
||||
virtual COLORREF GetBackColor() const;
|
||||
|
||||
// Input: lpszLink - Points to a null terminated string that represents the URL to
|
||||
// jump to. If NULL, the default URL is activated.
|
||||
// nShowCmd - Display state for shell command associated with the URL. The default
|
||||
// is SW_SHOW.
|
||||
// Returns: A value greater than 32 if successful, or an error value that is less than
|
||||
// or equal to 32 if unsuccessful.
|
||||
// Summary: This member function is called to execute the shell command associated
|
||||
// with the current URL.
|
||||
virtual HINSTANCE GotoURL(LPCTSTR lpszLink=NULL,int nShowCmd=SW_SHOW);
|
||||
|
||||
// Returns: true if the hyperlink control is a text control, otherwise returns false.
|
||||
// Summary: This member function checks to see if the hyperlink control is a
|
||||
// text control.
|
||||
virtual bool IsTextControl();
|
||||
|
||||
// Input: bEnable - true to enable tooltips.
|
||||
// Summary: Call this member function to enable or disable tooltips for the hyperlink
|
||||
// control.
|
||||
void EnableToolTips(bool bEnable=true);
|
||||
|
||||
// Input: lpszTipText - NULL terminated string that represents the new tooltip text to display.
|
||||
// Summary: Call this member function to set the tooltip text for the tooltip associated
|
||||
// with the hyperlink control.
|
||||
void SetTipText(LPCTSTR lpszTipText);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTHyperLink)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
protected:
|
||||
virtual void PreSubclassWindow();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual bool IsLinkHot();
|
||||
virtual void ReportError(int iErrorNo);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTHyperLink)
|
||||
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
|
||||
afx_msg UINT OnNcHitTest(CPoint point);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnTimer(UINT_PTR nIDEvent);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnClicked();
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTHyperLink::SetURL(LPCTSTR lpszLink) {
|
||||
m_strLink = lpszLink; if (!m_bInitControl) m_toolTip.UpdateTipText(lpszLink, this);
|
||||
}
|
||||
AFX_INLINE CString CXTHyperLink::GetURL() const {
|
||||
return m_strLink;
|
||||
}
|
||||
AFX_INLINE void CXTHyperLink::SetColors(COLORREF clrLink, COLORREF clrVisited, COLORREF clrHover) {
|
||||
m_clrLink = clrLink; m_clrVisited = clrVisited; m_clrHover = clrHover; Invalidate();
|
||||
}
|
||||
AFX_INLINE COLORREF CXTHyperLink::GetLinkColor() const {
|
||||
return m_clrLink;
|
||||
}
|
||||
AFX_INLINE COLORREF CXTHyperLink::GetVisitedColor() const {
|
||||
return m_clrVisited;
|
||||
}
|
||||
AFX_INLINE COLORREF CXTHyperLink::GetHoverColor() const {
|
||||
return m_clrHover;
|
||||
}
|
||||
AFX_INLINE void CXTHyperLink::SetVisited(bool bVisited) {
|
||||
m_bVisited = bVisited; InvalidateRect(NULL);
|
||||
}
|
||||
AFX_INLINE bool CXTHyperLink::GetVisited() const {
|
||||
return m_bVisited;
|
||||
}
|
||||
AFX_INLINE void CXTHyperLink::SetLinkCursor(HCURSOR hCursor) {
|
||||
m_hcurHand = hCursor;
|
||||
}
|
||||
AFX_INLINE HCURSOR CXTHyperLink::GetLinkCursor() const {
|
||||
return m_hcurHand;
|
||||
}
|
||||
AFX_INLINE void CXTHyperLink::SetUnderline(bool bUnderline) {
|
||||
m_bUnderline = bUnderline; SetFont(m_bUnderline ? &xtAfxData.fontULine : &xtAfxData.font); Invalidate();
|
||||
}
|
||||
AFX_INLINE bool CXTHyperLink::GetUnderline() const {
|
||||
return m_bUnderline;
|
||||
}
|
||||
AFX_INLINE bool CXTHyperLink::IsTextControl() {
|
||||
return ((GetStyle() & 0xFF) <= SS_RIGHT) ? true:false;
|
||||
}
|
||||
AFX_INLINE void CXTHyperLink::EnableShellExecute(bool bEnable) {
|
||||
m_bShellExec = bEnable;
|
||||
}
|
||||
AFX_INLINE void CXTHyperLink::SetBackColor(COLORREF clrBack) {
|
||||
m_clrBack = clrBack;
|
||||
}
|
||||
AFX_INLINE COLORREF CXTHyperLink::GetBackColor() const {
|
||||
return ( m_clrBack == -1 ) ? xtAfxData.clr3DFace : m_clrBack;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTHYPERLINK_H__)
|
||||
77
Editor/XT/Include/XTIconMap.h
Normal file
77
Editor/XT/Include/XTIconMap.h
Normal file
@@ -0,0 +1,77 @@
|
||||
// XTIconMap.h: interface for the CXTIconMap class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTICONMAP_H__)
|
||||
#define __XTICONMAP_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: Strucure used by CXTIconMap to hold up to three
|
||||
// icons per command that represent normal, disabled
|
||||
// and active icon states.
|
||||
struct XT_MAPENTRY
|
||||
{
|
||||
HICON hIcon; // Image icon.
|
||||
HICON hDisabledIcon; // Disabled image icon.
|
||||
HICON hHotIcon; // Hot image icon.
|
||||
};
|
||||
|
||||
// Summary: CMap definition for mapping XT_MAPENTRY structures.
|
||||
typedef CMap<UINT, UINT, XT_MAPENTRY, XT_MAPENTRY&> CXTMapEntry;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTIconMap is a CObject derived class. This class stores command to
|
||||
// icon associations. Icons are owned by this map and will be destroyed
|
||||
// once this object is destroyed.
|
||||
class CXTIconMap : public CObject
|
||||
{
|
||||
CXTMapEntry m_map; // A map of commands to their icons.
|
||||
|
||||
public:
|
||||
// Summary: Constructs a CXTIconMap object.
|
||||
CXTIconMap();
|
||||
|
||||
// Summary: Destroys a CXTIconMap object, handles cleanup and de-allocation. It
|
||||
// destroys the icons currently in the map.
|
||||
virtual ~CXTIconMap();
|
||||
|
||||
// Summary: This member function removes and destroys all icons in the map.
|
||||
void RemoveAll();
|
||||
|
||||
// Input: nCmdID - A UINT value that represents the command ID associated with the icon.
|
||||
// hIcon - Handle of the icon to associate with 'nCmdID'.
|
||||
// hDisabledIcon - Handle of the disabled icon to associate with 'nCmdID'.
|
||||
// hHotIcon - Handle of the hot icon to associate with 'nCmdID'.
|
||||
// Summary: This member function sets a command to icon association. The existing
|
||||
// icon, if any, will be destroyed.
|
||||
void SetAt(UINT nCmdID, HICON hIcon,HICON hDisabledIcon,HICON hHotIcon);
|
||||
|
||||
// Input: nCmdID - A UINT value that represents the command ID associated with the icon.
|
||||
// hIcon - Reference to an HICON object to receive the handle of the icon associated
|
||||
// with 'nCmdID'.
|
||||
// hDisabledIcon - Reference to an HICON object to receive the handle of the disabled
|
||||
// icon associated with 'nCmdID'.
|
||||
// hHotIcon - Reference to an HICON object to receive the handle of the hot
|
||||
// icon associated with 'nCmdID'.
|
||||
// Returns: TRUE if the icon exists, or FALSE if the icon does not exist.
|
||||
// Summary: This member function looks up an icon by its command ID.
|
||||
BOOL Lookup(UINT nCmdID, HICON& hIcon,HICON& hDisabledIcon,HICON& hHotIcon);
|
||||
|
||||
private:
|
||||
static void DestroyEntry(XT_MAPENTRY& entry);
|
||||
};
|
||||
|
||||
#endif // !defined(__XTICONMAP_H__)
|
||||
238
Editor/XT/Include/XTIncludes.h
Normal file
238
Editor/XT/Include/XTIncludes.h
Normal file
@@ -0,0 +1,238 @@
|
||||
// XTIncludes.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTINCLUDES_H__)
|
||||
#define __XTINCLUDES_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//--------------
|
||||
// MFC includes:
|
||||
//--------------
|
||||
|
||||
#ifndef _AFX_NO_OLE_SUPPORT
|
||||
#include <afxole.h>
|
||||
#endif // _AFX_NO_OLE_SUPPORT
|
||||
|
||||
#ifdef _MFC_OVERRIDES_NEW
|
||||
#define _INC_MALLOC
|
||||
#endif
|
||||
// MFC support for docking windows
|
||||
#include <afxpriv.h>
|
||||
// MFC template classes
|
||||
#include <afxtempl.h>
|
||||
// MFC ListView / TreeView support
|
||||
#include <afxcview.h>
|
||||
|
||||
#if _MFC_VER >= 0x0700 //MFC 7.0
|
||||
// MFC Global data
|
||||
#include <..\src\mfc\afximpl.h>
|
||||
#else
|
||||
// MFC Global data
|
||||
#include <..\src\mfc\\afximpl.h>
|
||||
#endif
|
||||
|
||||
// MFC support for shell extensions
|
||||
#include <shlobj.h>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: NOTE: If using the Xtreme Toolkit as a static library linked to an application
|
||||
// that is dynamically linked with MFC, you will need to do the following:
|
||||
//
|
||||
// Open the XTToolkit_Lib project workspace and select one of the
|
||||
// Win32 Dynamic build settings and build the library. Add the following lines
|
||||
// of code to your stdafx.h file:
|
||||
//
|
||||
// <pre>#define _XT_STATICLINK
|
||||
// #include <XTToolkit.h></pre>
|
||||
//
|
||||
// Add the following line of code to your *.rc2 file after the comment:
|
||||
// "Add manually edited resources here...":
|
||||
//
|
||||
// <pre>#include "XTResource.rc"</pre>
|
||||
#if !defined( _AFXDLL ) || defined( _XT_STATICLINK )
|
||||
#define _XT_EXT_CLASS
|
||||
#else
|
||||
#define _XT_EXT_CLASS __declspec( dllimport )
|
||||
#endif // !defined( _AFXDLL ) || defined( _XT_STATICLINK )
|
||||
|
||||
//-----------------------------------------
|
||||
// Xtreme global and resource definitions:
|
||||
//-----------------------------------------
|
||||
|
||||
#include "XTDefines.h"
|
||||
#include "XTGlobal.h"
|
||||
#include "XTResource.h"
|
||||
#include "XTFunctions.h"
|
||||
#include "XTVersion.h"
|
||||
#include "XTMemDC.h"
|
||||
|
||||
//-------------------------
|
||||
// Xtreme control classes:
|
||||
//-------------------------
|
||||
|
||||
#include "XTButton.h"
|
||||
#include "XTWndHook.h"
|
||||
#include "XTCoolMenu.h"
|
||||
#include "XTHexEdit.h"
|
||||
#include "XTFlatComboBox.h"
|
||||
#include "XTMaskEdit.h"
|
||||
#include "XTBrowseEdit.h"
|
||||
#include "XTCaption.h"
|
||||
#include "XTCaptionPopupWnd.h"
|
||||
#include "XTColorRef.h"
|
||||
#include "XTColorSelectorCtrl.h"
|
||||
#include "XTColorPopup.h"
|
||||
#include "XTColorPicker.h"
|
||||
#include "XTColorPageCustom.h"
|
||||
#include "XTColorPageStandard.h"
|
||||
#include "XTColorDialog.h"
|
||||
#include "XTEditListBox.h"
|
||||
#include "XTFontCombo.h"
|
||||
#include "XTComboBoxEx.h"
|
||||
#include "XTTabCtrl.h"
|
||||
#include "XTFlatTabCtrl.h"
|
||||
#include "XTTreeCtrl.h"
|
||||
#include "XTTreeView.h"
|
||||
#include "XTFlatHeaderCtrl.h"
|
||||
#include "XTListCtrl.h"
|
||||
#include "XTOutBarCtrl.h"
|
||||
#include "XTOutlookBar.h"
|
||||
#include "XTPagerCtrl.h"
|
||||
#include "XTDateTimeCtrl.h"
|
||||
#include "XTHyperLink.h"
|
||||
#include "XTTipWindow.h"
|
||||
#include "XTTipOfTheDay.h"
|
||||
#include "XTSplitterWnd.h"
|
||||
#include "XTStatusBar.h"
|
||||
#include "XTLogoPane.h"
|
||||
#include "XTMDIWndTab.h"
|
||||
#include "XTOSVersionInfo.h"
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Xtreme resizing dialog controls
|
||||
//------------------------------------------------------------------------------------
|
||||
|
||||
#include "XTResizeRect.h"
|
||||
#include "XTResizePoint.h"
|
||||
#include "XTResize.h"
|
||||
#include "XTResizeDialog.h"
|
||||
#include "XTResizeFormView.h"
|
||||
#include "XTResizePropertyPage.h"
|
||||
#include "XTResizePropertySheet.h"
|
||||
#include "XTSearchOptionsCtrl.h"
|
||||
#include "XTCBarDialog.h"
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Xtreme manager controls
|
||||
//------------------------------------------------------------------------------------
|
||||
|
||||
#include "XTIconMap.h"
|
||||
#include "XTToolsManager.h"
|
||||
#include "XTOptionsManager.h"
|
||||
#include "XTAccelManager.h"
|
||||
#include "XTAccelKeyEdit.h"
|
||||
|
||||
//-----------------------------------------------
|
||||
// Xtreme control bars -
|
||||
// Replaces: CControlBar, CDockBar, CDockContext:
|
||||
//-----------------------------------------------
|
||||
|
||||
#include "XTDelegate.h"
|
||||
#include "XTCustomizeAPI.h"
|
||||
#include "XTCallbacks.h"
|
||||
#include "XTControlBar.h"
|
||||
#include "XTDialogBar.h"
|
||||
#include "XTSplitterDock.h"
|
||||
#include "XTDockBar.h"
|
||||
#include "XTDockContext.h"
|
||||
#include "XTDockWindow.h"
|
||||
#include "XTTabCtrlBar.h"
|
||||
#include "XTDockColorSelector.h"
|
||||
|
||||
//------------------------------------------------------
|
||||
// Xtreme toolbars -
|
||||
// Replaces: CToolBar, CToolBarCtrl, CReBar, CReBarCtrl:
|
||||
//------------------------------------------------------
|
||||
|
||||
#include "XTToolBarCtrl.h"
|
||||
#include "XTToolBar.h"
|
||||
#include "XTMenuBar.h"
|
||||
#include "XTReBar.h"
|
||||
#include "XTReBarCtrl.h"
|
||||
#include "XTToolBarPopupWnd.h"
|
||||
#include "XTPopupTearOffWnd.h"
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Xtreme frame windows -
|
||||
// Replaces: CFrameWnd, CMDIFrameWnd, CMDIChildWnd, COleIPFrameWnd, CMiniDockFrameWnd:
|
||||
//------------------------------------------------------------------------------------
|
||||
|
||||
#include "XTFrameImpl.h"
|
||||
#include "XTFrameWnd.h"
|
||||
#include "XTMDIFrameWnd.h"
|
||||
#include "XTMDIChildWnd.h"
|
||||
|
||||
#ifndef _AFX_NO_OLE_SUPPORT
|
||||
#include "XTOleIPFrameWnd.h"
|
||||
#endif // _AFX_NO_OLE_SUPPORT
|
||||
|
||||
#include "XTMiniDockFrameWnd.h"
|
||||
|
||||
//-----------------------
|
||||
// Xtreme customization:
|
||||
//-----------------------
|
||||
|
||||
#include "XTCheckListBox.h"
|
||||
#include "XTCommandsListBox.h"
|
||||
#include "XTNewToolbarDlg.h"
|
||||
#include "XTCustomizePage.h"
|
||||
#include "XTCustomizeSheet.h"
|
||||
|
||||
//-----------------------
|
||||
// Xtreme CView classes:
|
||||
//-----------------------
|
||||
|
||||
#include "XTHtmlView.h"
|
||||
#include "XTListView.h"
|
||||
#include "XTPreviewView.h"
|
||||
#include "XTTabView.h"
|
||||
|
||||
//--------------------------
|
||||
// Xtreme shell extensions:
|
||||
//--------------------------
|
||||
|
||||
#include "XTDropSource.h"
|
||||
#include "XTShellPidl.h"
|
||||
#include "XTShellSettings.h"
|
||||
#include "XTShellTreeView.h"
|
||||
#include "XTShellTreeCtrl.h"
|
||||
#include "XTShellListView.h"
|
||||
#include "XTShellListCtrl.h"
|
||||
#include "XTTrayIcon.h"
|
||||
#include "XTBrowseDialog.h"
|
||||
|
||||
//----------------------------
|
||||
// Xtreme utility classes:
|
||||
//----------------------------
|
||||
|
||||
#include "XTWindowPos.h"
|
||||
#include "XTMemFile.h"
|
||||
#include "XTSortClass.h"
|
||||
#include "XTRegistryManager.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // #if !defined(__XTINCLUDES_H__)
|
||||
369
Editor/XT/Include/XTListCtrl.h
Normal file
369
Editor/XT/Include/XTListCtrl.h
Normal file
@@ -0,0 +1,369 @@
|
||||
// XTListCtrl.h interface for the CXTListCtrl class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTLISTCTRL_H__)
|
||||
#define __XTLISTCTRL_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTListCtrlBase is a non-inherited class. It implements the extended
|
||||
// list control services provided by the Xtreme Toolkit list control classes.
|
||||
class _XT_EXT_CLASS CXTListCtrlBase
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTListCtrlBase object.
|
||||
CXTListCtrlBase();
|
||||
|
||||
// Summary: Destroys a CXTListCtrlBase object, handles cleanup and de-allocation.
|
||||
virtual ~CXTListCtrlBase();
|
||||
|
||||
BOOL m_bAutoFont; // If TRUE, the font will automatically be set for the control.
|
||||
|
||||
protected:
|
||||
|
||||
class CListCtrl_Friendly : public CListCtrl
|
||||
{
|
||||
// Needed in order to access protected functions.
|
||||
|
||||
friend class CXTListCtrlBase;
|
||||
};
|
||||
|
||||
void ImplAttach(CListCtrl *pListCtrl);
|
||||
CListCtrl_Friendly *m_pListCtrl;
|
||||
|
||||
int m_nMinColWidth; // Minimum width for columns.
|
||||
int m_nMaxColWidth; // Maximum width for columns.
|
||||
int m_nSortedCol; // Index of the currently selected column.
|
||||
bool m_bNoColSizing; // If true, column sizing is disabled.
|
||||
bool m_bAscending; // Flag to determine the sorting order.
|
||||
bool m_bAutoSave; // true if saving the column widths.
|
||||
CString m_strSection; // Registry section name.
|
||||
CString m_strEntry; // Registry entry name.
|
||||
CString m_strDefault; // Registry default value.
|
||||
COLORREF m_clrText; // RGB value representing the row text color.
|
||||
COLORREF m_clrTextBk; // RGB value representing the row text background color.
|
||||
CXTFlatHeaderCtrl m_flatHeader; // Subclassed flat header control.
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Returns: A pointer to a CXTFlatHeaderCtrl if subclassed, otherwise returns NULL.
|
||||
// Summary: Call this member function to get a pointer to the flat header control.
|
||||
CXTFlatHeaderCtrl* GetFlatHeaderCtrl() const;
|
||||
|
||||
// Input: nCol - Zero-based index of the column to set the sort image for.
|
||||
// bAsc - TRUE if ascending, otherwise FALSE.
|
||||
// Returns: The zero-based index of the previously sorted column.
|
||||
// Summary: This member function will set the sort image for the specified column.
|
||||
virtual int SetSortImage(int nCol,BOOL bAsc);
|
||||
|
||||
// Input: nCol - Zero-based index of the column.
|
||||
// Returns: The column width stored in the registry.
|
||||
// Summary: This member function will return the column width stored in the
|
||||
// registry.
|
||||
virtual int GetStoredWidth(int nCol);
|
||||
|
||||
// Input: nCol - Zero-based index of the column.
|
||||
// Summary: This member function will set the column width from the registry
|
||||
// settings.
|
||||
virtual void SetStoredWidth(int nCol);
|
||||
|
||||
// Summary: This member function loads the column widths from the registry.
|
||||
virtual void LoadColumnWidths();
|
||||
|
||||
// Summary: This member function saves the column widths to the registry.
|
||||
virtual void SaveColumnWidths();
|
||||
|
||||
// Input: nCol - Zero-based index of the column.
|
||||
// Summary: This member function will automatically size a given column. Pass
|
||||
// in a -1 to auto-fit all columns.
|
||||
virtual void AutoSizeColumn(int nCol=-1);
|
||||
|
||||
// Input: lpszSection - Registry section name. If NULL, the default is "Settings".
|
||||
// lpszEntry - Registry entry name. If NULL, the default is "Column Info".
|
||||
// lpszDefault - Registry default value. If NULL, the default ID.
|
||||
// Summary: This member function will initialize the autosave feature. If called,
|
||||
// column widths will be saved to the system registry when the list control
|
||||
// window is destroyed.
|
||||
virtual void AutoSaveColumns(LPCTSTR lpszSection=NULL,LPCTSTR lpszEntry=NULL,LPCTSTR lpszDefault=NULL);
|
||||
|
||||
// Input: bBoldFont - true to use a bold font in the header control.
|
||||
// Summary: Call this member function to subclass the flat header control.
|
||||
virtual bool SubclassHeader(bool bBoldFont=false);
|
||||
|
||||
// Input: nCol - Passed in from the control. Index of the column clicked.
|
||||
// bAscending - Passed in from the control. true if sort order should
|
||||
// be ascending.
|
||||
// Summary: Override this member function in your derived class to perform custom
|
||||
// sort routines.
|
||||
virtual bool SortList(int nCol, bool bAscending);
|
||||
|
||||
// Input: dwExStyle - DWORD value that specifies the extended list-view control style. This
|
||||
// parameter can be a combination of Extended List-View Styles.
|
||||
// Summary: This member function is called to set extended styles for the list
|
||||
// control, ie: LVS_EX_FULLROWSELECT, LVS_EX_GRIDLINES, etc. See MSDN
|
||||
// documentation for a complete list of available styles.
|
||||
virtual void SetExtendedStyle(DWORD dwExStyle);
|
||||
|
||||
// Returns: A DWORD value that represents the extended style of the list control.
|
||||
// Summary: This member function is called to return the list control extended
|
||||
// style.
|
||||
virtual DWORD GetExtendedStyle();
|
||||
|
||||
// Input: bDisable - true to disable column sizing. false to enable.
|
||||
// Summary: Call this member function to enable or disable column sizing.
|
||||
virtual void DisableColumnSizing(bool bDisable);
|
||||
|
||||
// Input: nSize - Size, in pixels, of the column's minimum size.
|
||||
// Summary: Call this member function to set a minimum column size.
|
||||
void SetMinimumColSize(int nSize);
|
||||
|
||||
// Returns: An integer value that represents the minimum column size for the list control.
|
||||
// Summary: Call this member function to get the minimum column size for the list
|
||||
// control.
|
||||
int GetMinimumColSize();
|
||||
|
||||
// Returns: An integer value that represents the maximum column size for the list control.
|
||||
// Summary: Call this member function to get the maximum column size for the list control.
|
||||
int GetMaximumColSize();
|
||||
|
||||
// Input: point - Point to be tested.
|
||||
// col - Address of the column index
|
||||
// Returns: The row index, or -1 if 'point' is not over a row.
|
||||
// Summary: Call this member function to determine the row index and column
|
||||
// index for a 'point'.
|
||||
virtual int HitTestEx(CPoint &point,int *col) const;
|
||||
|
||||
// Input: lpszColHeading - The column's heading.
|
||||
// nWidth - Width of the column, in pixels. If this
|
||||
// parameter is -1, the column width is the
|
||||
// same as the previous column.
|
||||
// nFormat - The alignment of the column. It can be LVCFMT_LEFT,
|
||||
// LVCFMT_RIGHT, or LVCFMT_CENTER.
|
||||
// Returns: The index of the new column if successful, or -1 if unsuccessful.
|
||||
// Summary: Call this member function to add a column after the right most column.
|
||||
virtual int AddColumn(LPCTSTR lpszColHeading,int nWidth = -1,int nFormat=LVCFMT_LEFT);
|
||||
|
||||
// Input: nCols - Number of columns the list control contains.
|
||||
// nWidth - 'int' array containing the column widths.
|
||||
// strColString - CString array containing the string for each column.
|
||||
// Returns: true if successful, or false if an error occurred.
|
||||
// Summary: This member function will build the columns for the list control.
|
||||
virtual bool BuildColumns(int nCols,int* nWidth,CString* strColString );
|
||||
|
||||
// Input: nCols - Number of columns the list control contains.
|
||||
// nWidth - 'int' array containing the column widths.
|
||||
// nColString - 'int' array containing the string resource ID
|
||||
// for each column.
|
||||
// Returns: true if successful, or false if an error occurred.
|
||||
// Summary: This member function will build the columns for the list control.
|
||||
virtual bool BuildColumns(int nCols,int* nWidth,int* nColString );
|
||||
|
||||
// Input: clrText - RGB value representing the row text color.
|
||||
// clrTextBk - RGB value representing the row background color.
|
||||
// Summary: This member function sets the row, text, and background colors for
|
||||
// the list control.
|
||||
virtual void SetRowColors(COLORREF clrText,COLORREF clrTextBk);
|
||||
|
||||
// Returns: An RGB value that represents the background color.
|
||||
// Summary: This member function gets the RGB value defined for the list control's
|
||||
// background color.
|
||||
COLORREF GetBackColor();
|
||||
|
||||
// Returns: An RGB value that represents the text color.
|
||||
// Summary: This member function gets the RGB value defined for the list control's
|
||||
// text color.
|
||||
COLORREF GetTextColor();
|
||||
|
||||
// Returns: An integer value that represents the number of columns in the list.
|
||||
// Summary: This member function gets the number of columns in the list.
|
||||
virtual int GetColumnCount();
|
||||
|
||||
// Input: nFrom - Index of the source row.
|
||||
// nTo - Index of the destination row.
|
||||
// Returns: The index of the source row specified by 'nFrom'.
|
||||
// Summary: This member function copies a row to a new location.
|
||||
virtual int CopyRow(int nFrom,int nTo);
|
||||
|
||||
// Input: nFrom - Index of the source row
|
||||
// nTo - Index of the destination row
|
||||
// Returns: true if successful, or false if an error occurred.
|
||||
// Summary: This member function moves a row to a new location.
|
||||
virtual bool MoveRow(int nFrom,int nTo);
|
||||
|
||||
// Returns: A CHeaderCtrl pointer to the associated header control.
|
||||
// Summary: This member function is a utility function to retrieve the associated
|
||||
// header control.
|
||||
CHeaderCtrl *_xtGetHeaderCtrl() const;
|
||||
|
||||
#if _MSC_VER < 1200 //Ignore: MFC 5.0
|
||||
POSITION GetFirstSelectedItemPosition() const;
|
||||
int GetNextSelectedItem(POSITION& pos) const;
|
||||
#endif //Ignore: MFC 5.0
|
||||
|
||||
protected:
|
||||
|
||||
// message implementation
|
||||
|
||||
virtual BOOL OnNotifyImpl(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
|
||||
virtual void PreSubclassWindowImpl_Post();
|
||||
afx_msg void OnCustomDrawImpl(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnDestroyImpl_Pre();
|
||||
afx_msg BOOL OnEraseBkgndImpl(CDC* pDC);
|
||||
afx_msg void OnPaintImpl();
|
||||
afx_msg int OnCreateImpl_Post(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnSettingChangeImpl_Post(UINT uFlags, LPCTSTR lpszSection);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTListCtrl is a multiple inheritance class derived from CListCtrl and
|
||||
// CXTListCtrlBase. This class implements flat header and generic sorting
|
||||
// routines. See CXTListCtrlBase for additional functionality.
|
||||
// See Also: CXTListCtrlBase
|
||||
class _XT_EXT_CLASS CXTListCtrl : public CListCtrl, public CXTListCtrlBase
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTListCtrl)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTListCtrl object.
|
||||
CXTListCtrl();
|
||||
|
||||
// Summary: Destroys a CXTListCtrl object, handles cleanup and de-allocation.
|
||||
virtual ~CXTListCtrl();
|
||||
|
||||
// Input: dwExStyle - DWORD value that specifies the extended list-view control style. This
|
||||
// parameter can be a combination of Extended List-View Styles.
|
||||
// Summary: This member function is called to set extended styles for the list
|
||||
// control, ie: LVS_EX_FULLROWSELECT, LVS_EX_GRIDLINES, etc. See MSDN
|
||||
// documentation for a complete list of available styles.
|
||||
virtual void SetExtendedStyle(DWORD dwExStyle );
|
||||
|
||||
// Returns: A DWORD data type that represents the extended style of the list control.
|
||||
// Summary: This member function is called to retrieve the list control extended
|
||||
// style.
|
||||
DWORD GetExtendedStyle();
|
||||
|
||||
protected:
|
||||
|
||||
bool m_bInitControl; // true for initialization.
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTListCtrl)
|
||||
protected:
|
||||
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
|
||||
virtual void PreSubclassWindow();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTListCtrl)
|
||||
afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
|
||||
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
||||
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE DWORD CXTListCtrl::GetExtendedStyle() {
|
||||
return CXTListCtrlBase::GetExtendedStyle();
|
||||
}
|
||||
AFX_INLINE void CXTListCtrl::SetExtendedStyle(DWORD dwExStyle){
|
||||
CXTListCtrlBase::SetExtendedStyle(dwExStyle);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE DWORD CXTListCtrlBase::GetExtendedStyle() {
|
||||
ASSERT(::IsWindow(m_pListCtrl->GetSafeHwnd())); return (DWORD)m_pListCtrl->SendMessage(LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
|
||||
}
|
||||
AFX_INLINE void CXTListCtrlBase::SetExtendedStyle(DWORD dwExStyle) {
|
||||
ASSERT(::IsWindow(m_pListCtrl->GetSafeHwnd())); m_pListCtrl->SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, GetExtendedStyle()|dwExStyle);
|
||||
}
|
||||
AFX_INLINE int CXTListCtrlBase::SetSortImage( int nCol, BOOL bAsc ) {
|
||||
ASSERT(::IsWindow(m_pListCtrl->GetSafeHwnd())); return GetFlatHeaderCtrl()->SetSortImage(nCol, bAsc);
|
||||
}
|
||||
AFX_INLINE void CXTListCtrlBase::SetRowColors(COLORREF clrText, COLORREF clrTextBk) {
|
||||
m_clrText = clrText; m_clrTextBk = clrTextBk; m_pListCtrl->Invalidate();
|
||||
}
|
||||
AFX_INLINE void CXTListCtrlBase::SetMinimumColSize(int nSize) {
|
||||
m_nMinColWidth = nSize; GetFlatHeaderCtrl()->SetMinSize(nSize);
|
||||
}
|
||||
AFX_INLINE int CXTListCtrlBase::GetMinimumColSize() {
|
||||
return m_nMinColWidth;
|
||||
}
|
||||
AFX_INLINE int CXTListCtrlBase::GetMaximumColSize() {
|
||||
return m_nMaxColWidth;
|
||||
}
|
||||
AFX_INLINE void CXTListCtrlBase::DisableColumnSizing(bool bDisable) {
|
||||
m_bNoColSizing = bDisable;
|
||||
}
|
||||
AFX_INLINE CXTFlatHeaderCtrl* CXTListCtrlBase::GetFlatHeaderCtrl() const
|
||||
{
|
||||
CHeaderCtrl* pHeaderCtrl = _xtGetHeaderCtrl();
|
||||
if (pHeaderCtrl && pHeaderCtrl->IsKindOf(RUNTIME_CLASS(CXTFlatHeaderCtrl))) {
|
||||
return (CXTFlatHeaderCtrl*)pHeaderCtrl;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
AFX_INLINE CHeaderCtrl* CXTListCtrlBase::_xtGetHeaderCtrl() const
|
||||
{
|
||||
CHeaderCtrl * const pHeaderCtrl =
|
||||
(CHeaderCtrl*)m_pListCtrl->GetDlgItem(0);
|
||||
|
||||
// If the following assertion fails, you are performing an operation that
|
||||
// requires columns to be added, before you added columns.
|
||||
// For example, if you called SubclassHeader(), you need to make sure
|
||||
// that the call to SubClassHeader() is placed after calls to
|
||||
// InsertColumn().
|
||||
|
||||
ASSERT(pHeaderCtrl != NULL);
|
||||
return pHeaderCtrl;
|
||||
}
|
||||
AFX_INLINE COLORREF CXTListCtrlBase::GetBackColor() {
|
||||
return m_clrTextBk;
|
||||
}
|
||||
AFX_INLINE COLORREF CXTListCtrlBase::GetTextColor() {
|
||||
return m_clrText;
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if _MSC_VER < 1200 // MFC 5.0
|
||||
AFX_INLINE POSITION CXTListCtrlBase::GetFirstSelectedItemPosition() const {
|
||||
ASSERT(::IsWindow(m_pListCtrl->GetSafeHwnd())); return (POSITION) (1+m_pListCtrl->GetNextItem(-1, LVIS_SELECTED));
|
||||
}
|
||||
AFX_INLINE int CXTListCtrlBase::GetNextSelectedItem(POSITION& pos) const {
|
||||
ASSERT(::IsWindow(m_pListCtrl->GetSafeHwnd())); int nOldPos = (int)pos-1; pos = (POSITION) (1+m_pListCtrl->GetNextItem(nOldPos, LVIS_SELECTED)); return nOldPos;
|
||||
}
|
||||
#endif // MFC 5.0
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTLISTCTRL_H__)
|
||||
98
Editor/XT/Include/XTListView.h
Normal file
98
Editor/XT/Include/XTListView.h
Normal file
@@ -0,0 +1,98 @@
|
||||
// XTListView.h interface for the CXTListView class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTLISTVIEW_H__)
|
||||
#define __XTLISTVIEW_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTListView is a multiple inheritance class derived from CListView and
|
||||
// CXTListCtrlBase. This class implements flat header and generic sorting
|
||||
// routines.
|
||||
// See Also: CXTListCtrlBase
|
||||
class _XT_EXT_CLASS CXTListView : public CListView, public CXTListCtrlBase
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTListView)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTListView object.
|
||||
CXTListView();
|
||||
|
||||
// Summary: Destroys a CXTListView object, handles cleanup and de-allocation.
|
||||
virtual ~CXTListView();
|
||||
|
||||
// Input: dwExStyle - DWORD value that specifies the extended list-view control style. This
|
||||
// parameter can be a combination of Extended List-View Styles.
|
||||
// Summary: This member function is called to set extended styles for the list
|
||||
// control, ie: LVS_EX_FULLROWSELECT, LVS_EX_GRIDLINES, etc. See MSDN
|
||||
// documentation for a complete list of available styles.
|
||||
virtual void SetExtendedStyle(DWORD dwExStyle );
|
||||
|
||||
// Returns: A DWORD value representing the extended style of the list control.
|
||||
// Summary: This member function is called to return the list control extended
|
||||
// style.
|
||||
DWORD GetExtendedStyle();
|
||||
|
||||
protected:
|
||||
|
||||
public:
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTListView)
|
||||
public:
|
||||
virtual void OnInitialUpdate();
|
||||
protected:
|
||||
virtual void OnDraw(CDC* pDC);
|
||||
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
virtual void AssertValid() const;
|
||||
|
||||
virtual void Dump(
|
||||
CDumpContext& dc) const;
|
||||
|
||||
#endif
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTListView)
|
||||
afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE DWORD CXTListView::GetExtendedStyle() {
|
||||
return CXTListCtrlBase::GetExtendedStyle();
|
||||
}
|
||||
AFX_INLINE void CXTListView::SetExtendedStyle(DWORD dwExStyle){
|
||||
CXTListCtrlBase::SetExtendedStyle(dwExStyle);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTLISTVIEW_H__)
|
||||
204
Editor/XT/Include/XTLogoPane.h
Normal file
204
Editor/XT/Include/XTLogoPane.h
Normal file
@@ -0,0 +1,204 @@
|
||||
// XTLogoPane.h interface for the CXTLogoPane class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTLOGOPANE_H__)
|
||||
#define __XTLOGOPANE_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTBasePane is a CWnd derived class. It is the base class used for
|
||||
// creating CWnd objects to place in status bar panes that do custom paint
|
||||
// routines.
|
||||
class _XT_EXT_CLASS CXTBasePane : public CWnd
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTBasePane)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTBasePane object.
|
||||
CXTBasePane();
|
||||
|
||||
// Summary: Destroys a CXTBasePane object, handles cleanup and de-allocation.
|
||||
virtual ~CXTBasePane();
|
||||
|
||||
protected:
|
||||
|
||||
CString m_strWindowText; // NULL terminated string that represents the pane text.
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTLogoPane)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
public:
|
||||
|
||||
// Input: lpszWindowName - Text string to be associated with this pane.
|
||||
// pParentWnd - Pointer to the owner status bar window.
|
||||
// dwStyle - Window style.
|
||||
// nID - Control ID.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to create a status bar pane object that performs
|
||||
// custom draw routines.
|
||||
virtual BOOL Create(LPCTSTR lpszWindowName,CWnd* pParentWnd,DWORD dwStyle=WS_CHILD|WS_VISIBLE,UINT nID=0xffff);
|
||||
|
||||
protected:
|
||||
|
||||
// Input: pDC - Pointer to the device context.
|
||||
// rcClient - Size of the client area to draw.
|
||||
// Summary: Override this virtual function in your derived class to perform your
|
||||
// custom drawing routines.
|
||||
virtual void DoPaint(CDC* pDC,CRect& rcClient);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTBasePane)
|
||||
afx_msg void OnPaint();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTLogoPane is a CXTBasePane derived class. CXTLogoPane works with
|
||||
// CXTStatusBar and allows you to create a logo to place in your status
|
||||
// bar area.
|
||||
class _XT_EXT_CLASS CXTLogoPane : public CXTBasePane
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTLogoPane object.
|
||||
CXTLogoPane();
|
||||
|
||||
// Summary: Destroys a CXTLogoPane object, handles cleanup and de-allocation.
|
||||
virtual ~CXTLogoPane();
|
||||
|
||||
protected:
|
||||
|
||||
CFont m_Font; // Font to be used.
|
||||
CSize m_sizeText; // Size of the text to be displayed.
|
||||
|
||||
public:
|
||||
|
||||
// Input: lpszLogoText - A NULL terminated string that represents the text to be displayed.
|
||||
// Summary: This member function will set the text to be displayed in the logo
|
||||
// pane.
|
||||
virtual void SetLogoText(LPCTSTR lpszLogoText);
|
||||
|
||||
// Returns: A CString object that represents the text that is displayed
|
||||
// in the logo pane.
|
||||
// Summary: This member function returns a CString that represents the logo text.
|
||||
virtual CString GetLogoText();
|
||||
|
||||
// Input: lpszFontName - A NULL terminated string that represents the text to be displayed.
|
||||
// nHeight - Initial height for the font.
|
||||
// nWeight - Initial weight for the font.
|
||||
// bItalic - TRUE if the font is italic.
|
||||
// bUnderline - TRUE if the font is underlined.
|
||||
// Summary: This member function sets the font to be displayed in the logo pane.
|
||||
virtual void SetLogoFont(LPCTSTR lpszFontName,int nHeight=24,int nWeight=FW_BOLD,BOOL bItalic=TRUE,BOOL bUnderline=FALSE);
|
||||
|
||||
// Input: logFont - Address of a LOGFONT structure.
|
||||
// Summary: This member function sets the font to be displayed in the logo pane.
|
||||
virtual void SetLogoFont(LOGFONT& logFont);
|
||||
|
||||
// Returns: A CSize object that represents the current size of the logo pane text.
|
||||
// Summary: This member function will return the size of the text displayed in
|
||||
// the logo pane.
|
||||
CSize GetTextSize();
|
||||
|
||||
// Summary: This member function will calculate the size of the text that is displayed
|
||||
// in the logo pane and initializes 'm_sizeText'.
|
||||
void SetTextSize();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTLogoPane)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Input: pDC - Pointer to the device context.
|
||||
// rcClient - Size of the client area to draw.
|
||||
// Summary: Override this virtual function in your derived class to perform your
|
||||
// custom drawing routines.
|
||||
virtual void DoPaint(CDC* pDC,CRect& rcClient);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTLogoPane)
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE CSize CXTLogoPane::GetTextSize() {
|
||||
SetTextSize(); m_sizeText.cx+=2; return m_sizeText;
|
||||
}
|
||||
AFX_INLINE void CXTLogoPane::SetLogoText(LPCTSTR lpszLogoText) {
|
||||
m_strWindowText = lpszLogoText;
|
||||
}
|
||||
AFX_INLINE CString CXTLogoPane::GetLogoText() {
|
||||
return m_strWindowText;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTIconPane is a CXTBasePane derived class. CXTIconPane works with
|
||||
// CXTStatusBar and allows you to create a logo to place in your status
|
||||
// bar area.
|
||||
class _XT_EXT_CLASS CXTIconPane : public CXTBasePane
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTIconPane object.
|
||||
CXTIconPane();
|
||||
|
||||
// Summary: Destroys a CXTIconPane object, handles cleanup and de-allocation.
|
||||
virtual ~CXTIconPane();
|
||||
|
||||
protected:
|
||||
|
||||
CSize m_sizeIcon; // Size of the icon to display.
|
||||
CXTIconHandle m_hIcon; // Icon that is displayed in the status pane.
|
||||
|
||||
public:
|
||||
|
||||
// Input: nIconID - Resource ID of the icon to display.
|
||||
// Summary: Call this member function to set the pane icon for this object.
|
||||
void SetPaneIcon(int nIconID);
|
||||
|
||||
// Input: lpszIconID - Resource ID of the icon to display.
|
||||
// Summary: Call this member function to set the pane icon for this object.
|
||||
void SetPaneIcon(LPCTSTR lpszIconID);
|
||||
|
||||
// Input: pDC - Pointer to the device context.
|
||||
// rcClient - Size of the client area to draw.
|
||||
// Summary: Override this virtual function in your derived class to perform your
|
||||
// custom drawing routines.
|
||||
virtual void DoPaint(CDC* pDC,CRect& rcClient);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTIconPane)
|
||||
afx_msg void OnEnable(BOOL bEnable);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTLOGOPANE_H__)
|
||||
194
Editor/XT/Include/XTMDIChildWnd.h
Normal file
194
Editor/XT/Include/XTMDIChildWnd.h
Normal file
@@ -0,0 +1,194 @@
|
||||
// XTMDIChildWnd.h interface for the CXTMDIChildWnd class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTMDICHILDWND_H__)
|
||||
#define __XTMDICHILDWND_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTMDIChildWnd is a multiple inheritance class derived from CMDIChildWnd
|
||||
// and CXTFrameImpl. CXTMDIChildWnd extends the standard CMDIChildWnd class
|
||||
// to allow CXTDockWindow and CXTToolBar docking, customization, and cool
|
||||
// menu support.
|
||||
class _XT_EXT_CLASS CXTMDIChildWnd : public CMDIChildWnd, public CXTFrameImpl
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTMDIChildWnd)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTMDIChildWnd object.
|
||||
CXTMDIChildWnd();
|
||||
|
||||
// Summary: Destroys a CXTMDIChildWnd object, handles cleanup and de-allocation.
|
||||
virtual ~CXTMDIChildWnd();
|
||||
|
||||
// Input: lpszProfileName - Name of a section in the initialization file or a key in the
|
||||
// Windows registry where state information is stored.
|
||||
// Summary: This member function is called by the frame window to restore the
|
||||
// settings of the control bar.
|
||||
virtual void LoadBarState(LPCTSTR lpszProfileName);
|
||||
|
||||
// Input: lpszProfileName - Name of a section in the initialization file or a key in the
|
||||
// Windows registry where state information is stored.
|
||||
// Summary: This member function is called by the frame window to save the settings
|
||||
// of the control bar.
|
||||
virtual void SaveBarState(LPCTSTR lpszProfileName) const;
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwDockStyle - Specifies whether the control bar supports docking and the sides
|
||||
// of its parent window to which the control bar can be docked, if supported.
|
||||
// The style can be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_ALIGN_TOP</b> Allows docking at the top of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_BOTTOM</b> Allows docking at the bottom of
|
||||
// the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_LEFT</b> Allows docking on the left side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_RIGHT</b> Allows docking on the right side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_ANY</b> Allows docking on any side of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_FLOAT_MULTI</b> Allows multiple control bars to
|
||||
// be floated in a single mini-frame window.[/li]
|
||||
// [/ul]
|
||||
// If 0 (that is, indicating no flags), the control bar will not
|
||||
// dock.
|
||||
// Summary: Call this function to enable a control bar to be docked. The sides
|
||||
// specified must match one of the sides enabled for docking in the destination
|
||||
// frame window, or the control bar cannot be docked to that frame window.
|
||||
void EnableDocking(DWORD dwDockStyle);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwDockStyle - Specifies whether the control bar supports docking and the sides
|
||||
// of its parent window to which the control bar can be docked, if supported.
|
||||
// The style can be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_ALIGN_TOP</b> Allows docking at the top of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_BOTTOM</b> Allows docking at the bottom of
|
||||
// the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_LEFT</b> Allows docking on the left side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_RIGHT</b> Allows docking on the right side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_ANY</b> Allows docking on any side of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_FLOAT_MULTI</b> Allows multiple control bars to
|
||||
// be floated in a single mini-frame window.[/li]
|
||||
// [/ul]
|
||||
// If 0 (that is, indicating no flags), the control bar will not
|
||||
// dock.
|
||||
// dwFlatStyle - Specifies the look of the splitters that are inside dockbars.
|
||||
// It can be one of the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_XT_NONFLAT</b> Thick devstudio like non-flat splitters.[/li]
|
||||
// [li]<b>CBRS_XT_SEMIFLAT</b> Thin 3D non-flat splitters.[/li]
|
||||
// [li]<b>CBRS_XT_FLAT</b> Flat splitters.[/li]
|
||||
// [/ul]
|
||||
// Summary: Call this function to enable a control bar to be docked. The sides
|
||||
// specified must match one of the sides enabled for docking in the destination
|
||||
// frame window, or the control bar cannot be docked to that frame window.
|
||||
void EnableDockingEx(DWORD dwDockStyle,DWORD dwFlatStyle);
|
||||
|
||||
// Input: pBar - Points to the control bar to be docked.
|
||||
// pDockBar - Points to the dockbar the control bar is docked to.
|
||||
// lpRect - Determines, in screen coordinates, where the control bar will
|
||||
// be docked in the non-client area of the destination frame window.
|
||||
// Summary: This member function causes a control bar to be docked to the frame
|
||||
// window. The control bar will be docked to one of the sides of the
|
||||
// frame window specified in the calls to both CXTDockWindow::EnableDocking
|
||||
// and CXTFrameWnd::EnableDocking. The side chosen is determined by the
|
||||
// dockbar specified by 'pDockBar'.
|
||||
void DockControlBar(CControlBar* pBar,CDockBar* pDockBar,LPCRECT lpRect = NULL);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: pBar - Points to the control bar to be docked.
|
||||
// nDockBarID - Determines which sides of the frame window to consider for docking.
|
||||
// It can be 0, or one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_TOP</b> Dock to the top side of the
|
||||
// frame window.[/li]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_BOTTOM</b> Dock to the bottom side of
|
||||
// the frame window.[/li]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_LEFT</b> Dock to the left side of the
|
||||
// frame window.[/li]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_RIGHT</b> Dock to the right side of
|
||||
// the frame window.[/li]
|
||||
// [/ul]
|
||||
// If 0, the control bar can be docked to any side enabled for
|
||||
// docking in the destination frame window.
|
||||
// lpRect - Determines, in screen coordinates, where the control bar will
|
||||
// be docked in the non-client area of the destination frame window.
|
||||
// Summary: This member function causes a control bar to be docked to the frame
|
||||
// window. The control bar will be docked to one of the sides of the
|
||||
// frame window specified in the calls to both CXTDockWindow::EnableDocking
|
||||
// and CXTFrameWnd::EnableDocking. The side chosen is determined by
|
||||
// 'nDockBarID'.
|
||||
void DockControlBar(CControlBar* pBar,UINT nDockBarID = 0,LPCRECT lpRect = NULL);
|
||||
|
||||
// Input: pBar1 - A CControlBar pointer to the control bar to be docked.
|
||||
// pBar2 - A CControlBar pointer to the already docked control bar to be
|
||||
// redocked on the left of 'pBar1'.
|
||||
// Summary: This member function will redock a control bar specified by 'pBar2'
|
||||
// to the left of a newly docked control bar specified by 'pBar1'.
|
||||
virtual void DockControlBarLeftOf(CControlBar* pBar1,CControlBar* pBar2);
|
||||
|
||||
// Summary: Call this function to display the Customize Toolbar dialog box.
|
||||
// This dialog box allows the user to customize the toolbar by adding
|
||||
// and deleting buttons.
|
||||
void Customize();
|
||||
|
||||
protected:
|
||||
|
||||
CXTCoolMenu m_hookCoolMenus; // Cool menu hook.
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTMDIChildWnd)
|
||||
public:
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs, UINT uIcon);
|
||||
virtual void OnUpdateFrameTitle(BOOL bAddToTitle);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTMDIChildWnd)
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg void OnCustomizeBar();
|
||||
afx_msg void OnUpdateChevron(CCmdUI* pCmdUI);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
friend class CXTMDIFrameWnd;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTMDIChildWnd::Customize() {
|
||||
OnCustomizeBar();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTMDICHILDWND_H__)
|
||||
292
Editor/XT/Include/XTMDIFrameWnd.h
Normal file
292
Editor/XT/Include/XTMDIFrameWnd.h
Normal file
@@ -0,0 +1,292 @@
|
||||
// XTMDIFrameWnd.h interface for the CXTMDIFrameWnd class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTMDIFRAMEWND_H__)
|
||||
#define __XTMDIFRAMEWND_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTMDIFrameWnd is a multiple inheritance class derived from CMDIFrameWnd
|
||||
// and CXTFrameImpl. CXTMDIFrameWnd extends the standard CMDIFrameWnd
|
||||
// class to allow CXTDockWindow and CXTToolBar docking, customization,
|
||||
// and cool menu support.
|
||||
class _XT_EXT_CLASS CXTMDIFrameWnd : public CMDIFrameWnd, public CXTFrameImpl
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTMDIFrameWnd)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTMDIFrameWnd object.
|
||||
CXTMDIFrameWnd();
|
||||
|
||||
// Summary: Destroys a CXTMDIFrameWnd object, handles cleanup and de-allocation.
|
||||
virtual ~CXTMDIFrameWnd();
|
||||
|
||||
public:
|
||||
|
||||
// Returns: A pointer to a CXTCoolMenu object that represents the cool menu object
|
||||
// associated with the frame.
|
||||
// Summary: This member function gets a pointer to the cool menu object associated
|
||||
// with the frame.
|
||||
CXTCoolMenu* GetCoolMenu();
|
||||
|
||||
// Returns: A pointer to a CXTMenuBar object that represents the menu bar associated
|
||||
// with the frame.
|
||||
// Summary: This member function gets a pointer to the menu bar associated with
|
||||
// the frame.
|
||||
CXTMenuBar* GetMenuBar();
|
||||
|
||||
// Input: nIDToolBars - Array of toolbar resource IDs. The cool menu will use the toolbar
|
||||
// commands to map the icons placed next to the corresponding menu commands.
|
||||
// nSize - Size of the array of toolbars.
|
||||
// Summary: Call this member function to install cool menus for your application.
|
||||
// Cool menus are menus that appear with icons next to the menu titles.
|
||||
// Pass in your toolbar resource array to initialize.
|
||||
void InstallCoolMenus(const UINT* nIDToolBars,int nSize);
|
||||
|
||||
// Input: nIDToolBar - Toolbar resource ID. The cool menu will use the toolbar commands
|
||||
// to map the icons placed next to the corresponding menu commands.
|
||||
// Summary: Call this member function to install cool menus for your application.
|
||||
// Cool menus are menus that appear with icons next to the menu titles.
|
||||
// Pass in your toolbar resource to initialize.
|
||||
void InstallCoolMenus(const UINT nIDToolBar);
|
||||
|
||||
// Input: lpszProfileName - Name of a section in the initialization file or a key in the
|
||||
// Windows registry where state information is stored.
|
||||
// Summary: This member function is called by the frame window to restore the
|
||||
// settings of the control bar.
|
||||
virtual void LoadBarState(LPCTSTR lpszProfileName);
|
||||
|
||||
// Input: lpszProfileName - Name of a section in the initialization file or a key in the
|
||||
// Windows registry where state information is stored.
|
||||
// Summary: This member function is called by the frame window to save the settings
|
||||
// of the control bar.
|
||||
virtual void SaveBarState(LPCTSTR lpszProfileName) const;
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwDockStyle - Specifies whether the control bar supports docking and the sides
|
||||
// of its parent window to which the control bar can be docked, if supported.
|
||||
// The style can be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_ALIGN_TOP</b> Allows docking at the top of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_BOTTOM</b> Allows docking at the bottom of
|
||||
// the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_LEFT</b> Allows docking on the left side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_RIGHT</b> Allows docking on the right side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_ANY</b> Allows docking on any side of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_FLOAT_MULTI</b> Allows multiple control bars to
|
||||
// be floated in a single mini-frame window.[/li]
|
||||
// [/ul]
|
||||
// If 0 (that is, indicating no flags), the control
|
||||
// bar will not dock.
|
||||
// Summary: Call this function to enable a control bar to be docked. The sides
|
||||
// specified must match one of the sides enabled for docking in the destination
|
||||
// frame window, or the control bar cannot be docked to that frame window.
|
||||
void EnableDocking(DWORD dwDockStyle);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwDockStyle - Specifies whether the control bar supports docking and the sides
|
||||
// of its parent window to which the control bar can be docked, if supported.
|
||||
// The style can be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_ALIGN_TOP</b> Allows docking at the top of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_BOTTOM</b> Allows docking at the bottom of
|
||||
// the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_LEFT</b> Allows docking on the left side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_RIGHT</b> Allows docking on the right side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_ANY</b> Allows docking on any side of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_FLOAT_MULTI</b> Allows multiple control bars to
|
||||
// be floated in a single mini-frame window.[/li]
|
||||
// [/ul]
|
||||
// If 0 (that is, indicating no flags), the control
|
||||
// bar will not dock.
|
||||
// dwFlatStyle - Specifies the look of the splitters that are inside dockbars. It can be one
|
||||
// of the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_XT_NONFLAT</b> Thick devstudio like non-flat splitters.[/li]
|
||||
// [li]<b>CBRS_XT_SEMIFLAT</b> Thin 3D non-flat splitters.[/li]
|
||||
// [li]<b>CBRS_XT_FLAT</b> Flat splitters.[/li]
|
||||
// [/ul]
|
||||
// Summary: Call this function to enable a control bar to be docked. The sides
|
||||
// specified must match one of the sides enabled for docking in the destination
|
||||
// frame window, or the control bar cannot be docked to that frame window.
|
||||
void EnableDockingEx(DWORD dwDockStyle,DWORD dwFlatStyle);
|
||||
|
||||
// Input: pBar - A CControlBar pointer to the control bar to be docked.
|
||||
// pDockBar - A CDockBar pointer to the dockbar the control bar is docked to.
|
||||
// lpRect - Determines, in screen coordinates, where the control bar will
|
||||
// be docked in the non-client area of the destination frame window.
|
||||
// Summary: This member function causes a control bar to be docked to the frame
|
||||
// window. The control bar will be docked to one of the sides of the
|
||||
// frame window specified in the calls to both CXTDockWindow::EnableDocking
|
||||
// and CXTFrameWnd::EnableDocking. The side chosen is determined by the
|
||||
// dockbar specified by 'pDockBar'.
|
||||
void DockControlBar(CControlBar* pBar,CDockBar* pDockBar,LPCRECT lpRect = NULL);
|
||||
|
||||
// Input: pBar - A CControlBar pointer to the control bar to be docked.
|
||||
// nDockBarID - Determines which sides of the frame window to consider for docking.
|
||||
// It can be 0, or one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_TOP</b> Dock to the top side of the
|
||||
// frame window.[/li]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_BOTTOM</b> Dock to the bottom side of
|
||||
// the frame window.[/li]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_LEFT</b> Dock to the left side of the
|
||||
// frame window.[/li]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_RIGHT</b> Dock to the right side of
|
||||
// the frame window.[/li]
|
||||
// [/ul]
|
||||
// If 0, the control bar can be docked to any side enabled for
|
||||
// docking in the destination frame window.
|
||||
// lpRect - Determines, in screen coordinates, where the control bar will
|
||||
// be docked in the non-client area of the destination frame window.
|
||||
// Summary: This member function causes a control bar to be docked to the frame
|
||||
// window. The control bar will be docked to one of the sides of the frame
|
||||
// window specified in the calls to both CXTDockWindow::EnableDocking
|
||||
// and CXTFrameWnd::EnableDocking. The side chosen is determined by 'nDockBarID'.
|
||||
void DockControlBar(CControlBar* pBar,UINT nDockBarID = 0,LPCRECT lpRect = NULL);
|
||||
|
||||
// Input: pBar1 - A CControlBar pointer to the control bar to be docked.
|
||||
// pBar2 - A CControlBar pointer to the already docked control bar to be
|
||||
// redocked on the left of 'pBar1'.
|
||||
// Summary: This member function will redock a control bar specified by 'pBar2'
|
||||
// to the left of a newly docked control bar specified by 'pBar1'.
|
||||
virtual void DockControlBarLeftOf(CControlBar* pBar1,CControlBar* pBar2);
|
||||
|
||||
// Returns: A pointer to a CMenu object that represents the active
|
||||
// menu for the frame.
|
||||
// Summary: This member function retrieves a pointer to the menu for the frame
|
||||
// window.
|
||||
virtual CMenu* GetMenu() const;
|
||||
|
||||
// Input: nCommandID - The command ID of a menu item to hide.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified command to the list of menu
|
||||
// items to hide until activated by clicking on the chevron.
|
||||
virtual BOOL HideMenuItem(UINT nCommandID);
|
||||
|
||||
// Input: lpszItem - Text string representing the popup menu item to hide.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified menu item to the list of
|
||||
// menu items to hide until activated by clicking on the chevron.
|
||||
virtual BOOL HideMenuItem(LPCTSTR lpszItem);
|
||||
|
||||
// Input: IDs - An array of command IDs, of menu items, to hide.
|
||||
// nSize - Size of the array passed in.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified commands to the list of
|
||||
// menu items to hide until activated by clicking on the chevron.
|
||||
virtual BOOL HideMenuItems(const UINT* nCommandIDs,int nSize);
|
||||
|
||||
// Input: lpszItems - An array of command IDs, of menu items, to hide.
|
||||
// nSize - Size of the array passed in.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified menu items to the list of
|
||||
// menu items to hide until activated by clicking on the chevron.
|
||||
virtual BOOL HideMenuItems(const LPCTSTR lpszItems,int nSize);
|
||||
|
||||
// Summary: This member function redraws the menu bar. If a menu bar is changed
|
||||
// after Windows has created the window, call this function to draw the
|
||||
// changed menu bar. Overrides the CWnd implementation.
|
||||
void DrawMenuBarX();
|
||||
|
||||
// Summary: Call this function to display the Customize Toolbar dialog box.
|
||||
// This dialog box allows the user to customize the toolbar by adding
|
||||
// and deleting buttons.
|
||||
void Customize();
|
||||
|
||||
// Returns: true if successful, otherwise returnsfalse.
|
||||
// Summary: This member function will initialize the accelerator manager for the
|
||||
// framework.
|
||||
bool InitAccelManager();
|
||||
|
||||
// Input: iNormalIndex - Index where the 'Tools' menu should be inserted into the standard menu.
|
||||
// iWindowIndex - Index where the 'Tools' menu should be inserted into the MDI window menu.
|
||||
// iArgPopupMenu - Resource ID of the popup menu to be displayed for the Arguments
|
||||
// browse edit box.
|
||||
// iDirPopupMenu - Resource ID of the popup menu to be displayed for the Initial
|
||||
// Directory browse edit box.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to initialize the Tools manager for your
|
||||
// application. The Tools manager will insert a "Tools" menu into your
|
||||
// application's menu which allows the user to customize and add custom
|
||||
// commands the the menu. Typically used with toolbar customization,
|
||||
// the Tools manager should be initialized when your frame is loaded by
|
||||
// overriding the virtual function CFrameWnd::LoadFrame and can be managed
|
||||
// by selecting the 'Tools' tab in the Customize dialog.
|
||||
bool InitToolsManager(int iNormalIndex,int iWindowIndex=-1,int iArgPopupMenu=0,int iDirPopupMenu=0);
|
||||
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to initialize the Options manager for your
|
||||
// application. Typically used with toolbar customization, the Options
|
||||
// manager will allow the user to configure options related to the toolbar
|
||||
// and menu behavior for the application. The Options manager should
|
||||
// be initialized when your frame is loaded by overriding the virtual
|
||||
// function CFrameWnd::LoadFrame and can be managed by selecting the 'Options'
|
||||
// tab in the Customize dialog.
|
||||
bool InitOptionsManager();
|
||||
|
||||
protected:
|
||||
|
||||
virtual void SetDockState(const CXTDockState& state);
|
||||
virtual void GetDockState(CXTDockState& state) const;
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTMDIFrameWnd)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs, UINT uIcon);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTMDIFrameWnd)
|
||||
afx_msg void OnSysColorChange();
|
||||
afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
|
||||
afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg void OnCustomizeBar();
|
||||
afx_msg void OnWindowList();
|
||||
afx_msg BOOL OnToolsManager(UINT nID);
|
||||
afx_msg void OnUpdateToolsManager(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateChevron(CCmdUI* pCmdUI);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTMDIFrameWnd::Customize() {
|
||||
OnCustomizeBar();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTMDIFRAMEWND_H__)
|
||||
276
Editor/XT/Include/XTMDIWndTab.h
Normal file
276
Editor/XT/Include/XTMDIWndTab.h
Normal file
@@ -0,0 +1,276 @@
|
||||
// XTMDIWndTab.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTMDIWNDTAB_H__)
|
||||
#define __XTMDIWNDTAB_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
// forwards
|
||||
|
||||
class CXTMDIWndTab;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTMDIClientWnd is a CWnd derived helper class for the CXTMDIWndTab tab
|
||||
// control. This class routes messages sent to the client window back
|
||||
// to the tab control.
|
||||
class _XT_EXT_CLASS CXTMDIClientWnd : public CWnd
|
||||
{
|
||||
public:
|
||||
|
||||
// Input: pMDIWndTab - Pointer to a CXTMDITabWnd object.
|
||||
// Summary: Constructs a CXTMDIClientWnd object.
|
||||
CXTMDIClientWnd(CXTMDIWndTab* pMDIWndTab);
|
||||
|
||||
// Summary: Destroys a CXTMDIClientWnd object, handles cleanup and de-allocation.
|
||||
virtual ~CXTMDIClientWnd();
|
||||
|
||||
protected:
|
||||
|
||||
int m_iBorderGap; // Amount, in pixels, between the client and the tab control.
|
||||
CXTMDIWndTab* m_pMDIWndTab; // Pointer to the MDI tab control.
|
||||
|
||||
public:
|
||||
|
||||
// Input: iSize - Amount, in pixels, of gap between the tab control and the client.
|
||||
// Summary: This member function will set the size of the gap between the client
|
||||
// area and the tab control.
|
||||
void SetBorderGap(int iSize);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTMDIClientWnd)
|
||||
protected:
|
||||
virtual void CalcWindowRect(LPRECT lpClientRect, UINT nAdjustType = adjustBorder);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTMDIClientWnd)
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnMDICreate(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnMDIDestroy(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnMDIActivate(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTMDIClientWnd::SetBorderGap(int iBorderGap) {
|
||||
m_iBorderGap = iBorderGap;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_MDICHILD is a stand alone structure class. It is used to create
|
||||
// an XT_MDICHILD structure.
|
||||
struct XT_MDICHILD
|
||||
{
|
||||
int iItem; // Index of the item in the tab control.
|
||||
HWND hWnd; // Window handle of the tab item.
|
||||
CString strItem; // Tab label.
|
||||
};
|
||||
|
||||
// Summary: Array of XT_MDICHILD structs that represent each item in the tab control.
|
||||
typedef CList<XT_MDICHILD*,XT_MDICHILD*> CMDIChildArray;
|
||||
|
||||
// Summary: CMap definition for mapping icons with window handles.
|
||||
typedef CMap<HWND, HWND, HICON, HICON&> CXTIconWndMap;
|
||||
|
||||
// Summary: CMap definition for mapping strings to window handles.
|
||||
typedef CMap<HWND, HWND, CString, CString&> CXTStringMap;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTMDIWndTab is a multiple inheritance class derived from CTabCtrl and
|
||||
// CXTTabCtrlBase. CXTMDIWndTab is used to create a tab control for a multiple
|
||||
// document interface (MDI) application.
|
||||
class _XT_EXT_CLASS CXTMDIWndTab : public CTabCtrl, public CXTTabCtrlBase
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTMDIWndTab)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTMDIWndTab object.
|
||||
CXTMDIWndTab();
|
||||
|
||||
// Summary: Destroys a CXTMDIWndTab object, handles cleanup and de-allocation.
|
||||
virtual ~CXTMDIWndTab();
|
||||
|
||||
protected:
|
||||
|
||||
int m_iBorderGap; // Amount, in pixels, between the client and the tab control.
|
||||
int m_iHitTest; // Index of the tab that received a right click.
|
||||
int m_nPos; // Index of the popup menu contained in the menu.
|
||||
UINT m_nDefCmd; // Command ID of the default menu item for the popup menu.
|
||||
UINT m_popupMenuID; // Popup menu resource ID.
|
||||
HWND m_hActiveChild; // Active MDI child.
|
||||
BOOL m_bNoIcons; // TRUE if no icons are used.
|
||||
BOOL m_bRecalcLayoutPending; // Tells if a request to recalc the parent frame is pending.
|
||||
DWORD m_dwInitSignature; // Initialization state signature to synch up posted init requests.
|
||||
CImageList m_imageList; // Tab image list.
|
||||
CMDIFrameWnd* m_pMDIFrameWnd; // Points to the owner frame.
|
||||
CMDIChildArray m_arMDIChildern; // Array of the MDI windows added to the tab control.
|
||||
CXTMDIClientWnd* m_pMDIClientWnd; // Window that receives messages on behalf of the MDI client.
|
||||
CXTIconWndMap m_mapTabIcons; // Hash table that maps icons to the MDI child frame windows.
|
||||
CXTStringMap m_mapTabLabels; // Hash table that maps labels to the MDI child frame windows.
|
||||
|
||||
public:
|
||||
|
||||
// Input: iIndex - Zero-based index of the tab to set the tab icon for.
|
||||
// hIcon - Reference to an HICON handle that represents the tab icon.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to set the icon for the tab item specified
|
||||
// by 'iIndex'.
|
||||
bool SetTabIcon(int iIndex,HICON& hIcon);
|
||||
|
||||
// Input: hChildWnd - Valid HWND of the MDI child window to set the tab icon for.
|
||||
// hIcon - Reference to an HICON handle that represents the tab icon.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to set the icon for the tab item specified
|
||||
// by 'hChildWnd'.
|
||||
bool SetTabIcon(HWND hChildWnd,HICON& hIcon);
|
||||
|
||||
// Input: iIndex - Zero-based index of the tab to set the tab text for.
|
||||
// strLabel - Reference to a CString object that represents the tab label.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to set the label for the tab item specified
|
||||
// by 'iIndex'.
|
||||
bool SetTabLabel(int iIndex,CString& strLabel);
|
||||
|
||||
// Input: hChildWnd - Valid HWND of the MDI child window to set the tab text for.
|
||||
// strLabel - Reference to a CString object that represents the tab label.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to set the label for the tab item specified
|
||||
// by 'hChildWnd'.
|
||||
bool SetTabLabel(HWND hChildWnd,CString& strLabel);
|
||||
|
||||
// Input: pMDIFrameWnd - Points to the parent MDI frame window.
|
||||
// dwStyle - Style for the tab control. It can be any of the TCS_ values.
|
||||
// bNoIcons - Set to TRUE for no icon to display
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will install the MDI tab views with your application.
|
||||
virtual BOOL Install(CMDIFrameWnd* pMDIFrameWnd,DWORD dwStyle=TCS_BOTTOM|TCS_HOTTRACK,BOOL bNoIcons=xtAfxData.bXPMode);
|
||||
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function will uninstall the MDI tab views from your application.
|
||||
virtual BOOL UnInstall();
|
||||
|
||||
// Input: point - Pointer to a CPoint object that contains the cursor screen
|
||||
// coordinates. Use default for the current cursor position.
|
||||
// Returns: The zero-based index of the tab, or -1 if no tab is at the specified point.
|
||||
// Summary: Call this member function to retrieve the tab index from the current
|
||||
// cursor position.
|
||||
int TabFromPoint(CPoint point) const;
|
||||
|
||||
// Input: iIndex - Index of the tab control. If -1, then the tab under the mouse when
|
||||
// the last right click was performed will be used.
|
||||
// Returns: A CWnd object if successful, otherwise returns NULL.
|
||||
// Summary: This member function will return a pointer to the child frame associated
|
||||
// with the tab item.
|
||||
CMDIChildWnd* GetFrameWnd(int iIndex=-1) const;
|
||||
|
||||
// Input: point - CPoint object that represents the cursor position.
|
||||
// Returns: A CWnd object if successful, otherwise returns NULL.
|
||||
// Summary: This member function will return a pointer to the child frame associated
|
||||
// with the tab item.
|
||||
CMDIChildWnd* GetFrameWnd(CPoint point) const;
|
||||
|
||||
// Input: popupMenuID - ID for the tab control popup menu.
|
||||
// nPos - Index position in the menu resource.
|
||||
// nDefCmd - ID of the default menu command, will display bold.
|
||||
// Summary: This member function is used to set the resource ID for the popup menu
|
||||
// used by the tab control.
|
||||
void SetMenuID(UINT popupMenuID,int nPos=0,UINT nDefCmd=-1);
|
||||
|
||||
// Input: iSize - Amount, in pixels, of gap between the tab control and the client.
|
||||
// Summary: This member function will set the size of the gap between the client
|
||||
// area and the tab control.
|
||||
void SetBorderGap(int iSize);
|
||||
|
||||
// Input: hWnd - Handle to a valid CMDIChildWnd object.
|
||||
// Returns: A const CString object that represents the document title.
|
||||
// Summary: This member function will get the text for the specified MDI child
|
||||
// window.
|
||||
CString GetChildWndText(HWND hWnd) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Summary: This member function is called to initialize the font for the tab control
|
||||
// associated with this view.
|
||||
virtual void InitializeFont();
|
||||
|
||||
// Input: pChildFrame - A pointer to a valid child frame window.
|
||||
// bRecalcLayout - TRUE to force the MDI frame window to recalc the layout.
|
||||
// Summary: This member function is called to insert a child frame into the MDI
|
||||
// tab control.
|
||||
virtual void InsertTabWnd(CMDIChildWnd* pChildFrame,BOOL bRecalcLayout=TRUE);
|
||||
|
||||
// Returns: FALSE if there is no active document, otherwise returns TRUE.
|
||||
// Summary: This member function is called by the tab control to ensure the current
|
||||
// selection matches the active document.
|
||||
BOOL RefreshActiveSel();
|
||||
|
||||
// Summary: This member function is called by the tab control to ensure the tab
|
||||
// labels match their corresponding views.
|
||||
void RefreshTabLabels();
|
||||
|
||||
// Summary: This member function is called by the tab control to ensure the stored
|
||||
// indexes match their corresponding tab indexes.
|
||||
void RefreshIndexes();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTMDIWndTab)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual void OnMDICreate(HWND hWnd);
|
||||
virtual void OnMDIDestroy(HWND hWnd);
|
||||
virtual void OnMDIActivate(HWND hWnd);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTMDIWndTab)
|
||||
afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
|
||||
afx_msg void OnNcPaint();
|
||||
afx_msg void OnSelchange(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg void OnIdleUpdateCmdUI();
|
||||
afx_msg LRESULT OnXtUpdate(WPARAM, LPARAM);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
|
||||
afx_msg void OnSysColorChange();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnTabClose();
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
friend class CXTMDIClientWnd;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTMDIWndTab::SetMenuID(UINT popupMenuID, int nPos, UINT nDefCmd) {
|
||||
m_popupMenuID = popupMenuID; m_nPos = nPos; m_nDefCmd = nDefCmd;
|
||||
}
|
||||
AFX_INLINE void CXTMDIWndTab::SetBorderGap(int iBorderGap) {
|
||||
m_iBorderGap = iBorderGap; m_pMDIClientWnd->SetBorderGap(iBorderGap + ::GetSystemMetrics(SM_CXSIZEFRAME));
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(__XTMDIWNDTAB_H__)
|
||||
344
Editor/XT/Include/XTMaskEdit.h
Normal file
344
Editor/XT/Include/XTMaskEdit.h
Normal file
@@ -0,0 +1,344 @@
|
||||
// XTMaskEdit.h interface for the CXTMaskEdit class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTMASKEDIT_H__)
|
||||
#define __XTMASKEDIT_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTMaskEdit is a CXTFlatEdit derived class. It allows text masking to be
|
||||
// applied to the control to format it for special editing restrictions.
|
||||
class _XT_EXT_CLASS CXTMaskEdit : public CXTFlatEdit
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTMaskEdit)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTMaskEdit object.
|
||||
CXTMaskEdit();
|
||||
|
||||
// Summary: Destroys a CXTMaskEdit object, handles cleanup and de-allocation.
|
||||
virtual ~CXTMaskEdit();
|
||||
|
||||
protected:
|
||||
|
||||
int m_nStartChar; // Current position of the first character in the current selection.
|
||||
int m_nEndChar; // Current position of the first non-selected character past the end of the current selection.
|
||||
bool m_bUseMask; // true to use the edit mask.
|
||||
bool m_bOverType; // true to over type the text, set with VK_INSERT key press.
|
||||
bool m_bRedo; // true to redo, or false to undo.
|
||||
bool m_bModified; // true if mask edit has been modified.
|
||||
TCHAR m_chPrompt; // Prompt character used to identify the text entry.
|
||||
CString m_strMask; // Buffer that holds the actual edit mask value.
|
||||
CString m_strDefault; // Contains the edit controls default display text.
|
||||
CString m_strUndoBuffer; // Holds the contents of the undo buffer.
|
||||
CString m_strRedoBuffer; // Holds the contents of the redo buffer.
|
||||
CXTString m_strWindowText; // Buffer that holds the actual edit text.
|
||||
CXTString m_strLiteral; // Literal format that restricts where the user can enter text.
|
||||
|
||||
public:
|
||||
|
||||
// Input: bUseMask - true to enable the mask. false to disable the mask.
|
||||
// Summary: Call this member function to enable or disable the mask for the mask
|
||||
// edit control.
|
||||
void SetUseMask(bool bUseMask);
|
||||
|
||||
// Returns: true if the mask can be used, otherwise returns false.
|
||||
// Summary: This member function is called to determine if the mask for the edit
|
||||
// control can be used.
|
||||
bool CanUseMask();
|
||||
|
||||
// Input: bOverType - true to enable type over.
|
||||
// Summary: This member function is called to enable or disable type over, also
|
||||
// known as insert mode.
|
||||
void SetOverType(bool bOverType);
|
||||
|
||||
// Returns: true if type over is enabled, otherwise returns false.
|
||||
// Summary: This member function is called to determine if type over has been enabled.
|
||||
bool CanOverType();
|
||||
|
||||
// Input: iPos - Index of the character to check.
|
||||
// Returns: true if the index is valid, otherwise returns false.
|
||||
// Summary: This member function is called to determine if the index specified
|
||||
// by 'iPos' is a valid index for the currently displayed edit text.
|
||||
bool PosInRange(int iPos);
|
||||
|
||||
// Returns: A TCHAR data type.
|
||||
// Summary: This member function retrieves the character that is currently used as
|
||||
// the mask prompt. The mask prompt indicates that the field is editable.
|
||||
TCHAR GetPromptChar();
|
||||
|
||||
// Input: ch - A TCHAR data type.
|
||||
// Summary: This member function is called to set the prompt character that is
|
||||
// displayed to the user that indicates the field can be edited.
|
||||
void SetPromptChar(TCHAR ch);
|
||||
|
||||
// Summary: This member function is called to perform a cut operation using the
|
||||
// currently selected text.
|
||||
void MaskCut();
|
||||
|
||||
// Summary: This member function is called to perform a copy operation using the
|
||||
// currently selected text.
|
||||
void MaskCopy();
|
||||
|
||||
// Summary: This member function is called to perform a paste operation using the
|
||||
// current clipboard text.
|
||||
void MaskPaste();
|
||||
|
||||
// Summary: This member function is called to clear the current text selection.
|
||||
void MaskClear();
|
||||
|
||||
// Summary: This member function is called to undo the previous action.
|
||||
void MaskUndo();
|
||||
|
||||
// Summary: This member function is called to select all text in the mask edit
|
||||
// control.
|
||||
void MaskSelectAll();
|
||||
|
||||
// Returns: true if the text has changed, otherwise returns false.
|
||||
// Summary: This member function is called to determine if the text has been modified.
|
||||
bool IsModified();
|
||||
|
||||
// Input: lpszMask - The format for the mask field. For example, if you wanted to set
|
||||
// the mask for a phone number, and you only wanted digits to be entered,
|
||||
// your mask might look like this; _T("(000) 000-0000").
|
||||
// lpszLiteral - The literal format is entered here. Wherever you place an underscore
|
||||
// ('_') is where the user will be allowed to enter data only. Using
|
||||
// the phone number example; _T("(___) ___-____").
|
||||
// lpszDefault - Text that is to be displayed when the control is initialized. For
|
||||
// example; _T("(800) 555-1212"). If NULL, 'lpszLiteral' is used to initialize
|
||||
// the edit text.
|
||||
// Summary: This member function will set the mask for the edit control. The values
|
||||
// that can be set are:
|
||||
//
|
||||
// <pre>
|
||||
// <b>Mask Character</b> <b>Description</b>
|
||||
// -------------------------------------------------
|
||||
// 0 Numeric (0-9)
|
||||
// 9 Numeric (0-9) or space (' ')
|
||||
// # Numeric (0-9) or space (' ') or ('+') or ('-')
|
||||
// L Alpha (a-Z)
|
||||
// ? Alpha (a-Z) or space (' ')
|
||||
// A Alpha numeric (0-9 and a-Z)
|
||||
// a Alpha numeric (0-9 and a-Z) or space (' ')
|
||||
// & All print character only
|
||||
// H Hex digit (0-9 and A-F)
|
||||
// X Hex digit (0-9 and A-F) and space (' ')
|
||||
// > Forces characters to upper case (A-Z)
|
||||
// < Forces characters to lower case (a-z)</pre>
|
||||
virtual void SetEditMask(LPCTSTR lpszMask,LPCTSTR lpszLiteral,LPCTSTR lpszDefault=NULL);
|
||||
|
||||
// Input: nChar - Contains the character code value of the key.
|
||||
// bBeep - true to enable beep. false to disable beep.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function is used internally to validate the character indicated
|
||||
// by 'nChar'.
|
||||
virtual bool CheckChar(UINT& nChar,bool bBeep=true);
|
||||
|
||||
// Input: nChar - Contains the character code value of the key.
|
||||
// nEndPos - Index of character in display string.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function is used internally to process the character passed
|
||||
// in by 'nChar' whose index is specified by 'nEndPos'.
|
||||
virtual bool ProcessMask(UINT& nChar,int nEndPos);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTMaskEdit)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual bool CorrectPosition(int& iPos, bool bForward=true, bool bBeep=true);
|
||||
virtual void DeleteCharAt(int iPos);
|
||||
virtual void InsertCharAt(int iPos, TCHAR nChar);
|
||||
virtual bool CopyToClipboard(LPCTSTR lpszText);
|
||||
virtual CString GetMaskedText(int iPos=0);
|
||||
virtual BOOL SelectionMade();
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTMaskEdit)
|
||||
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnSetFocus(CWnd* pOldWnd);
|
||||
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
|
||||
afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
|
||||
afx_msg void OnEditCut( );
|
||||
afx_msg void OnEditCopy( );
|
||||
afx_msg void OnEditPaste( );
|
||||
afx_msg void OnEditClear( );
|
||||
afx_msg void OnEditUndo( );
|
||||
afx_msg void OnEditSelectAll( );
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTMaskEdit::SetUseMask(bool bUseMask ) {
|
||||
m_bUseMask = bUseMask;
|
||||
}
|
||||
AFX_INLINE bool CXTMaskEdit::CanUseMask() {
|
||||
return m_bUseMask;
|
||||
}
|
||||
AFX_INLINE void CXTMaskEdit::SetOverType(bool bOverType) {
|
||||
m_bOverType = bOverType;
|
||||
}
|
||||
AFX_INLINE bool CXTMaskEdit::CanOverType() {
|
||||
return m_bOverType;
|
||||
}
|
||||
AFX_INLINE bool CXTMaskEdit::PosInRange(int iPos) {
|
||||
return ( ( iPos >= 0 ) && ( iPos < m_strLiteral.GetLength( ) ) );
|
||||
}
|
||||
AFX_INLINE TCHAR CXTMaskEdit::GetPromptChar() {
|
||||
return m_chPrompt;
|
||||
}
|
||||
AFX_INLINE BOOL CXTMaskEdit::SelectionMade() {
|
||||
GetSel( m_nStartChar, m_nEndChar ); return ( m_nStartChar != m_nEndChar );
|
||||
}
|
||||
AFX_INLINE bool CXTMaskEdit::IsModified() {
|
||||
return m_bModified;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTDateEdit is a CXTMaskEdit derived class. It is specifically
|
||||
// geared toward editing date fields.
|
||||
class _XT_EXT_CLASS CXTDateEdit : public CXTMaskEdit
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTDateEdit)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTDateEdit object.
|
||||
CXTDateEdit();
|
||||
|
||||
// Input: dt - A reference to a COleDateTime object that represents the
|
||||
// date to display.
|
||||
// Summary: This member function will set the time based on the text string
|
||||
// passed in as 'strDate'.
|
||||
virtual void SetDateTime(COleDateTime& dt);
|
||||
|
||||
// Input: strDate - A NULL terminated string that represents the date to display.
|
||||
// Summary: This member function will set the time based on the text string
|
||||
// passed in as 'strDate'.
|
||||
virtual void SetDateTime(CString strDate);
|
||||
|
||||
// Returns: A COleDateTime object representing the currently displayed date.
|
||||
// Summary: This member function will retrieve a COleDateTime object that
|
||||
// represents the currently displayed date.
|
||||
virtual COleDateTime GetDateTime();
|
||||
|
||||
// Returns: A CString object representing the currently displayed date.
|
||||
// Summary: This member function will retrieve a CString object that represents
|
||||
// the currently displayed date.
|
||||
virtual CString GetWindowDateTime();
|
||||
|
||||
// Input: lpszData - A NULL terminated string that represents the date to convert.
|
||||
// Returns: A COleDateTime object that represents the converted date string.
|
||||
// Summary: This member function will read the date string passed in as 'lpszData'
|
||||
// and is converted and returned as a COleDateTime object.
|
||||
virtual COleDateTime ReadOleDateTime(LPCTSTR lpszData);
|
||||
|
||||
// Input: nChar - Contains the character code value of the key.
|
||||
// nEndPos - Index of character in display string.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function is used internally to process the character passed
|
||||
// in by 'nChar' whose index is specified by 'nEndPos'.
|
||||
virtual bool ProcessMask(UINT nChar,int nEndPos);
|
||||
|
||||
// Input: strData - String reference that is filled with the date.
|
||||
// dt - COleDateTime object that represents the date to format.
|
||||
// Summary: This member function will read the date passed in as 'dt', and format
|
||||
// the 'strData' string as DD/MM/YY.
|
||||
virtual void FormatOleDateTime(CString& strData,COleDateTime dt);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTTimeEdit is a CXTDateEdit derived class. It is specifically geared
|
||||
// toward editing time fields.
|
||||
class _XT_EXT_CLASS CXTTimeEdit : public CXTDateEdit
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTTimeEdit)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTTimeEdit object.
|
||||
CXTTimeEdit();
|
||||
|
||||
protected:
|
||||
|
||||
int m_iHours; // Represents the hours to display.
|
||||
int m_iMins; // Represents the minutes to display.
|
||||
bool m_bMilitary; // true if military time is used.
|
||||
|
||||
public:
|
||||
|
||||
// Input: nHours - The new hour to be displayed.
|
||||
// Summary: This member function will update the hours displayed.
|
||||
virtual void SetHours(int nHours);
|
||||
|
||||
// Input: nMins - The new minutes to be displayed.
|
||||
// Summary: This member function will update the minutes displayed.
|
||||
virtual void SetMins(int nMins);
|
||||
|
||||
// Input: nHours - The new hour to be displayed.
|
||||
// nMins - The new minutes to be displayed.
|
||||
// Summary: This member function will update the hours and minutes that are displayed
|
||||
// for the time edit control.
|
||||
virtual void SetTime(int nHours,int nMins);
|
||||
|
||||
// Returns: An integer value that represents the hours displayed.
|
||||
// Summary: This member function will retrieve the hours displayed for the time edit
|
||||
// control.
|
||||
int GetHours() const;
|
||||
|
||||
// Returns: An integer value that represents the minutes displayed.
|
||||
// Summary: This member function will retrieve the minutes displayed for the time
|
||||
// edit control.
|
||||
int GetMins() const;
|
||||
|
||||
// Input: nChar - Contains the character code value of the key.
|
||||
// nEndPos - Index of the character in the display string.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function is used internally to process the character
|
||||
// passed in by 'nChar' whose index is specified by 'nEndPos'.
|
||||
virtual bool ProcessMask(UINT nChar,int nEndPos);
|
||||
|
||||
// Input: strData - String reference that is filled with the time.
|
||||
// dt - COleDateTime object that represents the time to format.
|
||||
// Summary: This member function will read the time passed in as 'dt',
|
||||
// and format the 'strData' string as HH:MM.
|
||||
virtual void FormatOleDateTime(CString& strData,COleDateTime dt);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE int CXTTimeEdit::GetHours() const {
|
||||
return m_iHours;
|
||||
}
|
||||
AFX_INLINE int CXTTimeEdit::GetMins() const {
|
||||
return m_iMins;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTMASKEDIT_H__)
|
||||
82
Editor/XT/Include/XTMemDC.h
Normal file
82
Editor/XT/Include/XTMemDC.h
Normal file
@@ -0,0 +1,82 @@
|
||||
// XTMemDC.h interface for the CXTMemDC class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTMEMDC_H__)
|
||||
#define __XTMEMDC_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTMemDC is a CDC derived class. CXTMemDC is an extension of CDC that
|
||||
// helps eliminate screen flicker when windows are resized, by painting
|
||||
// to an off screen bitmap. The class then uses CDC::BitBlt to copy the
|
||||
// bitmap back into the current device context after all items have been
|
||||
// painted.
|
||||
class _XT_EXT_CLASS CXTMemDC : public CDC
|
||||
{
|
||||
public:
|
||||
DECLARE_DYNAMIC(CXTMemDC);
|
||||
|
||||
// Input: pDC - A Pointer to the current device context.
|
||||
// rect - Represents the size of the area to paint.
|
||||
// clrColor - An RGB value that represents the background color of the area to paint.
|
||||
// Defaults to COLOR_3DFACE. Pass in a value of -1 to disable background
|
||||
// painting.
|
||||
// Summary: Constructs a CXTMemDC object.
|
||||
CXTMemDC(CDC* pDC,const CRect& rect,COLORREF clrColor=xtAfxData.clr3DFace);
|
||||
|
||||
// Summary: Destroys a CXTMemDC object, handles cleanup and de-allocation.
|
||||
virtual ~CXTMemDC();
|
||||
|
||||
// Summary: This member function is called to set the valid flag to false so the
|
||||
// offscreen device context will not be drawn.
|
||||
void Discard();
|
||||
|
||||
// Summary: This member function gets content from the given DC.
|
||||
void FromDC();
|
||||
|
||||
// Returns: A reference to the CBitmap object associated with the memory device context.
|
||||
// Summary: This member function retrieves a reference to the CBitmap object
|
||||
// associated with the memory device context.
|
||||
CBitmap& GetBitmap();
|
||||
|
||||
protected:
|
||||
|
||||
CDC* m_pDC; // Saves the CDC passed in constructor.
|
||||
BOOL m_bValid; // Flag used for autodraw in destructor.
|
||||
CRect m_rc; // Rectangle of the drawing area.
|
||||
CBitmap m_bitmap; // Offscreen bitmap.
|
||||
HBITMAP m_hOldBitmap; // Original GDI object.
|
||||
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE CBitmap& CXTMemDC::GetBitmap() {
|
||||
return m_bitmap;
|
||||
}
|
||||
AFX_INLINE void CXTMemDC::Discard() {
|
||||
m_bValid = FALSE;
|
||||
}
|
||||
AFX_INLINE void CXTMemDC::FromDC() {
|
||||
BitBlt(0, 0, m_rc.Width(), m_rc.Height(), m_pDC, m_rc.left, m_rc.top, SRCCOPY);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTMEMDC_H__)
|
||||
278
Editor/XT/Include/XTMemFile.h
Normal file
278
Editor/XT/Include/XTMemFile.h
Normal file
@@ -0,0 +1,278 @@
|
||||
// XTMemFile.h interface for the CXTMemFile class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//---------------------------------------------------------------------------
|
||||
// Used with permission Copyright <20> 1999 Maxallion
|
||||
// XFile@maxallion.8m.com
|
||||
//---------------------------------------------------------------------------
|
||||
// ICQ# 32304418
|
||||
//
|
||||
// CCJMemFile - Extended Memory File - Beta - w/o a lot of error checking
|
||||
// - Is used like a normal CFile or CStdioFile or CMemFile object
|
||||
// - String Functions : ReadString, WriteString
|
||||
// - Loads physical files into memory on creation and saves them back to disk on destruction
|
||||
// - Can duplicate itself to other CFile derived objects
|
||||
// - Has a Search function
|
||||
// - can be read-accessed like an array
|
||||
//
|
||||
// OVERLOADED OPERATORS:
|
||||
// = Imports from another file or sets file Position
|
||||
// += Appends another file
|
||||
// [] reads a byte like an array
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTMEMFILE_H__)
|
||||
#define __XTMEMFILE_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTMemFile is a CMemFile derived class. It is used to create a CXTMemFile
|
||||
// object to support memory files.
|
||||
//
|
||||
// These memory files behave like disk files except that the file is stored
|
||||
// in RAM rather than on disk. A memory file is useful for fast temporary
|
||||
// storage or for transferring raw bytes or serialized objects between
|
||||
// independent processes.
|
||||
//
|
||||
// CXTMemFile objects can automatically allocate their own memory, or you
|
||||
// can attach your own memory block to the CXTMemFile object by calling
|
||||
// Attach. In either case, memory for growing the memory file automatically
|
||||
// is allocated in nGrowBytes-sized increments if 'nGrowBytes' is not zero.
|
||||
//
|
||||
// The memory block will automatically be deleted upon destruction of the
|
||||
// CXTMemFile object if the memory was originally allocated by the CXTMemFile
|
||||
// object. Otherwise, you are responsible for de-allocating the memory you
|
||||
// attached to the object.
|
||||
//
|
||||
// You can access the memory block through the pointer supplied when you
|
||||
// detach it from the CXTMemFile object by calling Detach.
|
||||
//
|
||||
// The most common use of CXTMemFile is to create a CXTMemFile object and
|
||||
// use it by calling CFile member functions. Note that creating a CXTMemFile
|
||||
// automatically opens it: you do not call CFile::Open, which is only used
|
||||
// for disk files. Because CXTMemFile doesn't use a disk file, the data
|
||||
// member CFile::m_hFile is not used and has no meaning.
|
||||
//
|
||||
// The CFile member functions Duplicate, LockRange, and UnlockRange are
|
||||
// not implemented for CXTMemFile. If you call these functions on a CXTMemFile
|
||||
// object, you will get a CNotSupportedException.
|
||||
//
|
||||
// CXTMemFile uses the run-time library functions malloc, realloc, and
|
||||
// free to allocate, reallocate, and deallocate memory, and the intrinsic
|
||||
// memcpy to block copy memory when reading and writing. If you would like
|
||||
// to change this behavior or the behavior when CXTMemFile grows a file,
|
||||
// derive your own class from CXTMemFile and override the appropriate functions.
|
||||
class _XT_EXT_CLASS CXTMemFile : public CMemFile
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
// Input: nGrowBytes - The memory allocation increment in bytes.
|
||||
// Summary: Constructs a CXTMemFile object. This overload opens an empty memory
|
||||
// file. Note that the file is opened by the constructor and that you
|
||||
// should not call CFile::Open.
|
||||
CXTMemFile(UINT nGrowBytes = 1024 );
|
||||
|
||||
// Input: lpBuffer - Pointer to the buffer to be attached to CXTMemFile.
|
||||
// nBufferSize - An integer that specifies the size of the buffer in bytes.
|
||||
// nGrowBytes - The memory allocation increment in bytes.
|
||||
// Summary: Constructs a CXTMemFile object. This overload acts the same as
|
||||
// if you used the first constructor and immediately called Attach with
|
||||
// the same parameters.
|
||||
CXTMemFile(BYTE* lpBuffer,UINT nBufferSize,UINT nGrowBytes = 0);
|
||||
|
||||
// Input: lpstFilename - A string that is the path to the desired file. The path can be relative,
|
||||
// absolute, or a network name (UNC).
|
||||
// uiOpenFlags - A UINT that defines the file<6C>s sharing and access mode. It specifies
|
||||
// the action to take when opening the file. You can combine options
|
||||
// by using the bitwise-OR ( | ) operator. One access permission and
|
||||
// one share option are required. The modeCreate and modeNoInherit modes
|
||||
// are optional. See the CFile constructor for a list of mode options.
|
||||
// Summary: Constructs a CXTMemFile object.
|
||||
CXTMemFile(LPCTSTR lpstFilename,UINT uiOpenFlags);
|
||||
|
||||
// Summary: Destroys a CXTMemFile object, handles cleanup and de-allocation.
|
||||
virtual ~CXTMemFile();
|
||||
|
||||
private:
|
||||
|
||||
UINT m_uiOpenFlags;
|
||||
bool m_bOpen;
|
||||
CFile m_File;
|
||||
CFileException* m_pError;
|
||||
|
||||
public:
|
||||
|
||||
// Summary: This member function forces any data remaining in the file buffer
|
||||
// to be written to the file. The use of Flush does not guarantee flushing
|
||||
// of CArchive buffers. If you are using an archive, call CArchive::Flush
|
||||
// first.
|
||||
virtual void Flush();
|
||||
|
||||
#if _MFC_VER >= 0x0700 //MFC 7.0
|
||||
using CMemFile::Open;
|
||||
#endif
|
||||
|
||||
// Input: strFilename - Specifies a NULL terminated string that is the path to the desired file.
|
||||
// uiOpenFlags - Specifies a UINT that defines the sharing and access mode in the file.
|
||||
// It specifies the action to take when opening the file. You can combine
|
||||
// options by using the bitwise-OR ( | ) operator. One access permission
|
||||
// and one share option are required. The modeCreate and modeNoInherit
|
||||
// modes are optional. See the CFile constructor for a list of mode options.
|
||||
// pError - Specifies a pointer to an existing file-exception object that receives
|
||||
// the status of a failed operation.
|
||||
// Returns: true if successful, or false if it fails.
|
||||
// Summary: This member function opens and loads a physical File into memory.
|
||||
virtual bool Open(CString strFilename, UINT uiOpenFlags, CFileException* pError = NULL);
|
||||
|
||||
// Summary: This member function saves the contents of the memory to the disk
|
||||
// and closes it.
|
||||
virtual void Close();
|
||||
|
||||
// Input: rString - A CString reference to an object to receive the string that is read.
|
||||
// Returns: TRUE if successful, or FALSE if there is an error.
|
||||
// Summary: This member function reads a string.
|
||||
virtual BOOL ReadString(CString& rString);
|
||||
|
||||
// Input: lpsz - Specifies a pointer to a buffer containing a null-terminated text
|
||||
// string.
|
||||
// Summary: This method writes data from a buffer to the file associated with
|
||||
// the CArchive object. The terminating null character, \0, is not written
|
||||
// to the file, nor is a newline character automatically written.
|
||||
virtual void WriteString( LPCTSTR lpsz );
|
||||
|
||||
#if _MFC_VER >= 0x0700 //MFC 7.0
|
||||
using CMemFile::Duplicate;
|
||||
#endif //MFC 7.0
|
||||
|
||||
// Input: fDuplicate - A pointer to a valid CFile object.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function will initialize the CXTMemFile object with
|
||||
// the information specified in the 'fDuplicate' object.
|
||||
virtual bool Duplicate(CFile *fDuplicate);
|
||||
|
||||
// Input: strDup - A NULL terminated string.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function will initialize the CXTMemFile object with
|
||||
// the information specified in the 'strDup' string object.
|
||||
virtual bool Duplicate(CString strDup);
|
||||
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function discards all changes to file since Open() or
|
||||
// last Flush().
|
||||
virtual bool Discard();
|
||||
|
||||
// Input: fSrc - A pointer to a valid CFile object.
|
||||
// dwSourcePos - Represents the source file position.
|
||||
// dwDestPos - Represents the destination file position.
|
||||
// dwBytes - Number of bytes to insert.
|
||||
// Returns: A DWORD value that represents the length of the copied bytes.
|
||||
// Summary: This member function inserts any File and returns the length of the actual
|
||||
// copied bytes.
|
||||
virtual DWORD Insert(CFile* fSrc, DWORD dwSourcePos, DWORD dwDestPos, DWORD dwBytes);
|
||||
|
||||
// Input: strSrc - Specifies a NULL terminated string that is the path to the desired
|
||||
// file.
|
||||
// dwSourcePos - Represents the source file position.
|
||||
// dwDestPos - Represents the destination file position.
|
||||
// dwBytes - Number of bytes to insert.
|
||||
// Returns: A DWORD value that represents the length of the copied bytes.
|
||||
// Summary: This member function inserts any File and returns the length of
|
||||
// the actual copied bytes.
|
||||
virtual DWORD Insert(CString strSrc, DWORD dwSourcePos, DWORD dwDestPos, DWORD dwBytes);
|
||||
|
||||
// Input: fDest - A pointer to a valid CFile object.
|
||||
// dwStartPos - Represents the starting position.
|
||||
// dwBytes - Number of bytes to extract.
|
||||
// Returns: A DWORD value that represents the length of the copied bytes.
|
||||
// Summary: This member function extracts bytes to a file and returns the length
|
||||
// of the actual copied bytes.
|
||||
virtual DWORD Extract(CFile *fDest,DWORD dwStartPos, DWORD dwBytes);
|
||||
|
||||
// Input: strDest - Specifies a NULL terminated string that is the path to the desired
|
||||
// file.
|
||||
// dwStartPos - Represents the starting position.
|
||||
// dwBytes - Number of bytes to extract.
|
||||
// Returns: A DWORD value that represents the length of the copied bytes.
|
||||
// Summary: This member function extracts bytes to a file and returns the length
|
||||
// of the actual copied bytes.
|
||||
virtual DWORD Extract(CString strDest, DWORD dwStartPos, DWORD dwBytes);
|
||||
|
||||
// Input: pData - Pointer to the buffer to receive the data found.
|
||||
// dwDataLen - Size of the data to find.
|
||||
// lStartPos - Starting position.
|
||||
// Returns: A LONG data type.
|
||||
// Summary: This member function finds data in the file.
|
||||
LONG FindData(void* pData, DWORD dwDataLen, LONG lStartPos);
|
||||
|
||||
// Input: fDup - A pointer to a valid CFile object.
|
||||
// Summary: This member operator will initialize the CXTMemFile object with
|
||||
// the object specified by 'fDup'.
|
||||
void operator =(CFile* fDup);
|
||||
|
||||
// Input: strDup - Specifies a NULL terminated string that is the path to the desired
|
||||
// file.
|
||||
// Summary: This member operator will initialize the CXTMemFile object with
|
||||
// the object specified by 'strDup'.
|
||||
void operator =(CString strDup);
|
||||
|
||||
// Input: dwFilePos - DWORD value that specifies file position.
|
||||
// Summary: This member operator will adjust the file position.
|
||||
void operator =(DWORD dwFilePos);
|
||||
|
||||
// Input: fApp - A pointer to a valid CFile object.
|
||||
// Summary: This member operator will append the CXTMemFile object with the object
|
||||
// specified by 'fApp'.
|
||||
void operator +=(CFile *fApp);
|
||||
|
||||
// Input: strApp - Specifies a NULL terminated string that is the path to the desired
|
||||
// file.
|
||||
// Summary: This member operator will append the CXTMemFile object with the object
|
||||
// specified by 'strApp'.
|
||||
void operator +=(CString strApp);
|
||||
|
||||
// Input: dwFilePos - DWORD value that specifies file position.
|
||||
// Summary: This member operator will perform indexing operations for the CXTMemFile
|
||||
// object. Returns a BYTE data type.
|
||||
BYTE operator [](DWORD dwFilePos);
|
||||
|
||||
protected:
|
||||
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function loads the file into memory.
|
||||
virtual bool Load();
|
||||
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function saves the file to disk.
|
||||
virtual bool Save();
|
||||
|
||||
// Input: fImp - A pointer to a valid CFile object.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function imports the data of a CFile derived object
|
||||
// (operator = ).
|
||||
virtual bool Import(CFile *fImp);
|
||||
|
||||
// Input: fApp - A pointer to a valid CFile object.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function appends a CFile derived object to the file
|
||||
// (operator += ).
|
||||
virtual bool Append(CFile* fApp);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTMEMFILE_H__)
|
||||
702
Editor/XT/Include/XTMenuBar.h
Normal file
702
Editor/XT/Include/XTMenuBar.h
Normal file
@@ -0,0 +1,702 @@
|
||||
// XTMenuBar.h interface for the CXTMenuBar class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTMENUBAR_H__)
|
||||
#define __XTMENUBAR_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
// forwards
|
||||
|
||||
class CXTMenu;
|
||||
class CXTMenuBarItem;
|
||||
class CXTToolsManager;
|
||||
class CXTSysMenuBarItem;
|
||||
class CXTSubMenuBarItem;
|
||||
class CXTControlMenuBarItem;
|
||||
class CXTMenuCustomHandler;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_TRACK_STATE - Enumeration used by CXTMenuBar to determine the current
|
||||
// state of the menu bar.
|
||||
typedef enum XT_TRACK_STATE
|
||||
{
|
||||
TRACK_NONE = 0, // Normal, not tracking anything.
|
||||
TRACK_BUTTON, // Tracking buttons (F10/Alt mode).
|
||||
TRACK_POPUP // Tracking popups.
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTMenuBarItem - Descriptor of a generic menu bar item
|
||||
class _XT_EXT_CLASS CXTMenuBarItem : public CObject
|
||||
{
|
||||
bool m_bWrapped; // Tells if this item is a line wrap
|
||||
CPoint m_ptOrigin; // Origin of this item (its NW corner)
|
||||
CXTMenuBar* const m_pMenuBar; // Owner of this item
|
||||
|
||||
public:
|
||||
|
||||
// Input: pMenuBar - Points to a CXTMenuBar object.
|
||||
// Summary: Constructor initializes with default values
|
||||
CXTMenuBarItem(CXTMenuBar* pMenuBar);
|
||||
|
||||
// Returns: true if the item is hidden, otherwise returns false.
|
||||
// Summary: Tells if this item is currently hidden.
|
||||
virtual bool IsHidden() const;
|
||||
|
||||
// Returns: A pointer to a CXTMenuBar object.
|
||||
// Summary: Call this member function to return a pointer to the menubar.
|
||||
CXTMenuBar* GetMenuBar() const;
|
||||
|
||||
// Input: pDC - Pointer to a valid device context.
|
||||
// Summary: Renders this item.
|
||||
virtual void Render(CDC* pDC) = 0;
|
||||
|
||||
// Input: pchAccelerator - A NULL terminated string.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Retrieves accelerator for this item if one exists .
|
||||
virtual bool GetAccelerator(TCHAR* pchAccelerator);
|
||||
|
||||
// Returns: A CSize object.
|
||||
// Summary: Gets this item extent.
|
||||
virtual CSize GetExtent() = 0;
|
||||
|
||||
// Returns: true if the menubar is wrapped, otherwise returns false.
|
||||
// Summary: Call this member function to determine if the menubar is wrapped.
|
||||
bool IsWrapped() const;
|
||||
|
||||
// Returns: true if the menubar is wrappable, otherwise returns false.
|
||||
// Summary: Call this member function to determine if the menubar is wrappable.
|
||||
virtual bool IsWrappable() const;
|
||||
|
||||
// Input: bWrapped - True if the menubar is to be wrappable.
|
||||
// Summary: Call this member funciton to set the wrappable state for the menubar.
|
||||
void SetWrapped(bool bWrapped);
|
||||
|
||||
// Returns: A CPoint object.
|
||||
// Summary: Gets this item origin (its NW point)
|
||||
CPoint GetOrigin() const;
|
||||
|
||||
// Input: ptOrigin - A CPoint object.
|
||||
// Summary: Gets this item origin (its NW point).
|
||||
void SetOrigin(CPoint ptOrigin);
|
||||
|
||||
// Returns: The amount in pixels representing spacing.
|
||||
// Summary: Spacer specifies a distance between this and the following
|
||||
// menu bar item, applicable if there is next item and this one is not
|
||||
// wrapped.
|
||||
virtual int GetSpacer() const;
|
||||
|
||||
// Summary: Tracks associated popup menu, if any.
|
||||
virtual void TrackMenu();
|
||||
|
||||
// Summary: Handles double click on this item.
|
||||
virtual void OnDblClick();
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE bool CXTMenuBarItem::IsHidden() const {
|
||||
/*// not hidden by default*/return false;
|
||||
}
|
||||
AFX_INLINE CXTMenuBar* CXTMenuBarItem::GetMenuBar() const {
|
||||
return m_pMenuBar;
|
||||
}
|
||||
AFX_INLINE bool CXTMenuBarItem::GetAccelerator(TCHAR* /*pchAccelerator*/) {
|
||||
return false;
|
||||
}
|
||||
AFX_INLINE bool CXTMenuBarItem::IsWrapped() const {
|
||||
return IsWrappable() && m_bWrapped;
|
||||
}
|
||||
AFX_INLINE bool CXTMenuBarItem::IsWrappable() const {
|
||||
return true;
|
||||
}
|
||||
AFX_INLINE void CXTMenuBarItem::SetWrapped(bool bWrapped) {
|
||||
ASSERT(IsWrappable()); m_bWrapped = bWrapped;
|
||||
}
|
||||
AFX_INLINE CPoint CXTMenuBarItem::GetOrigin() const {
|
||||
return m_ptOrigin;
|
||||
}
|
||||
AFX_INLINE void CXTMenuBarItem::SetOrigin(CPoint ptOrigin) {
|
||||
m_ptOrigin = ptOrigin;
|
||||
}
|
||||
AFX_INLINE int CXTMenuBarItem::GetSpacer() const {
|
||||
return 0;
|
||||
}
|
||||
AFX_INLINE void CXTMenuBarItem::TrackMenu() {
|
||||
}
|
||||
AFX_INLINE void CXTMenuBarItem::OnDblClick() {
|
||||
}
|
||||
|
||||
// Summary: CMap definition for mapping OLE items.
|
||||
typedef CMap<long, long, BOOL, BOOL> CXTMenu2OLEItemMap;
|
||||
|
||||
// Summary: CTypedPtrArray definition for CXTMenuBarItem object arrays.
|
||||
typedef CTypedPtrArray<CObArray, CXTMenuBarItem*> CXTMenuBarItemArray;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTMenuBar is a CXTControlBar derived class. It is used to create an
|
||||
// Office™ style menu bar. Use it the way you would a CToolBar, only you
|
||||
// need to call LoadMenuBar instead of LoadToolbar.
|
||||
class _XT_EXT_CLASS CXTMenuBar : public CXTControlBar
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTMenuBar)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTMenuBar object.
|
||||
CXTMenuBar();
|
||||
|
||||
// Summary: Destroys a CXTMenuBar object, handles cleanup and de-allocation.
|
||||
virtual ~CXTMenuBar();
|
||||
|
||||
protected:
|
||||
|
||||
int m_iDepressedItem; // Index of the currently depressed item.
|
||||
int m_iTracking; // Index of the frame control button being tracked.
|
||||
int m_iHotItem; // Index of the currently hot item.
|
||||
int m_nIDEvent; // Menu timer ID.
|
||||
int m_nTimeOut; // Time-out value, in milliseconds.
|
||||
int m_iPopupTracking; // Index of which popup is being tracked, if any.
|
||||
int m_iNewPopup; // Index of the next menu to track.
|
||||
int m_iButton; // Index of the currently selected menu bar item.
|
||||
int m_nMenuID; // Menu bar resource ID.
|
||||
int m_nMRUMaxWidth; // Most recently used max width, or -1 if not set.
|
||||
bool m_bTimerActive; // true when the timer is activated.
|
||||
bool m_bMoreWindows; // true to display the "More Windows" menu command for MDI document management.
|
||||
bool m_bStretchToFit; // true if the menu bar is stretched to fit the entire window space.
|
||||
bool m_bPtMouseInit; // Tells if the last mouse position (m_ptMouse) has been initialized.
|
||||
bool m_bShowMDIButtons; // Tells if MDI buttons shall be rendered when the MDI child is maximized.
|
||||
bool m_bDown; // true when the button is pressed.
|
||||
bool m_bProcessRightArrow; // true to process left/right arrow keys.
|
||||
bool m_bProcessLeftArrow; // true to move to prev/next popup.
|
||||
bool m_bEscapeWasPressed; // true if the user pressed escape to exit the menu.
|
||||
bool m_bDelayCheckMouse; // Tells if idle update shall check for the mouse position to reset the hot item once the mouse leaves the window.
|
||||
BOOL m_bMenuUnderlines; // Win2000, TRUE if 'use menu underlines' is turned off in the control panel.
|
||||
BOOL m_bActive; // TRUE, if the application has activation.
|
||||
BOOL m_bMDIMaximized; // TRUE, if the window is maximized.
|
||||
HWND m_hWndMDIClient; // If this is an MDI application.
|
||||
HMENU m_hMenu; // Handle to the currently active menu.
|
||||
HMENU m_hMenuDefault; // Handle to the menu loaded via LoadMenuBar.
|
||||
HMENU m_hMenuShared; // Handle to the "Window" menu.
|
||||
CPoint m_ptMouse; // Mouse location when tracking the popup.
|
||||
CString m_strValueName; // Null-terminated string that specifies the value name in the registry.
|
||||
CString m_strSubKey; // Null-terminated string that specifies the key name in the registry.
|
||||
CXTMenu* m_pMenuPopup; // Pointer to the current popup being tracked.
|
||||
CUIntArray m_arrHiddenCommands; // Array of hidden menu commands.
|
||||
static int m_iHookRefCount; // Counts number of times the hook has been set.
|
||||
CImageList m_imageList; // Image list used by the MDI frame buttons.
|
||||
CToolTipCtrl m_toolTip; // MDI frame button tooltip.
|
||||
static HHOOK m_hMsgHook; // Handle to the message hook. Set during menu tracking.
|
||||
XT_TRACK_STATE m_iTrackingState; // Current tracking state.
|
||||
CXTMBarWndHook* m_pFrameHook; // Hooks frame window messages.
|
||||
CXTMBarMDIWndHook* m_pChildFrameHook; // Hooks MDI client messages.
|
||||
static CXTMenuBar* m_pMenuBar; // Holds a 'this' pointer. Set during menu tracking.
|
||||
CXTMenu2OLEItemMap m_mapMenu2OLEItem; // OLE menu item routing map.
|
||||
CXTMenuBarItemArray m_arrItems; // Array of menu bar items.
|
||||
|
||||
private:
|
||||
|
||||
CXTMenuCustomHandler* m_pCustomHandler;
|
||||
CMap<HMENU,HMENU,HMENU,HMENU> m_mapTools;
|
||||
|
||||
public:
|
||||
|
||||
static bool m_bShowAll; // true when hidden menu items are displayed.
|
||||
static bool m_bAltKey; // true when the alt key is pressed.
|
||||
|
||||
// Input: pMsg - Pointer to an MSG structure.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This function translates special menu keys and mouse actions, and is
|
||||
// called from CXTFrameWnd's PreTranslateMessage.
|
||||
virtual BOOL TranslateFrameMessage(MSG* pMsg);
|
||||
|
||||
// Input: hMenu - Handle to the new menu.
|
||||
// hMenuShared - Handle to the new shared menu.
|
||||
// Returns: A handle to the old menu. 'hMenuShared' is the MDI "Window" menu, if any
|
||||
// (similar to WM_MDISETMENU).
|
||||
// Summary: Call this function to load a different menu. The HMENU must not belong
|
||||
// to any CMenu, and you must free it when you are done.
|
||||
HMENU LoadMenu(HMENU hMenu,HMENU hMenuShared);
|
||||
|
||||
// Returns: A CMenu pointer object to the currently active menu.
|
||||
// Summary: This member function retrieves a pointer to the currently active menu.
|
||||
CMenu* GetMenu() const;
|
||||
|
||||
// Input: nMenuID - Resource ID of the menu to load.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to load the menu bar specified by 'nMenuID'.
|
||||
BOOL LoadMenuBar(UINT nMenuID);
|
||||
|
||||
// Input: lpszMenuName - Pointer to the resource name of the menu bar to be loaded.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to load the menu bar specified by 'lpszMenuName'.
|
||||
BOOL LoadMenuBar(LPCTSTR lpszMenuName);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: pParentWnd - Pointer to the window that is the menu bar<61>s parent.
|
||||
// dwStyle - The menu bar style. Additional menu bar styles supported are:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_TOP</b> Control bar is at the top of the frame window.[/li]
|
||||
// [li]<b>CBRS_BOTTOM</b> Control bar is at the bottom of the frame window.[/li]
|
||||
// [li]<b>CBRS_NOALIGN</b> Control bar is not repositioned when the
|
||||
// parent is resized.[/li]
|
||||
// [li]<b>CBRS_TOOLTIPS</b> Control bar displays tool tips.[/li]
|
||||
// [li]<b>CBRS_SIZE_DYNAMIC</b> Control bar is dynamic.[/li]
|
||||
// [li]<b>CBRS_SIZE_FIXED</b> Control bar is fixed.[/li]
|
||||
// [li]<b>CBRS_FLOATING</b> Control bar is floating.[/li]
|
||||
// [li]<b>CBRS_FLYBY</b> Status bar displays information about the button.[/li]
|
||||
// [li]<b>CBRS_HIDE_INPLACE</b> Control bar is not displayed to the user.[/li]
|
||||
// [/ul]
|
||||
// nID - The menu bar<61>s child-window ID.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function creates a Windows menu bar, a child window, and
|
||||
// associates it with the CXTMenuBar object. It also sets the menu bar
|
||||
// height to a default value.
|
||||
virtual BOOL Create(CWnd* pParentWnd,DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP,UINT nID = AFX_IDW_MENUBAR);
|
||||
|
||||
// Input: pParentWnd - Pointer to the window that is the menu bar<61>s parent.
|
||||
// dwUnused - Not used, should be zero.
|
||||
// dwStyle - The menu bar style. See Toolbar Control and Button Styles in the Platform
|
||||
// SDK for a list of appropriate styles.
|
||||
// rcBorders - A CRect object that defines the widths of the menu bar window borders.
|
||||
// These borders are set to (0,0,0,0) by default, thereby resulting in
|
||||
// a menu bar window with no borders.
|
||||
// nID - The menu bar<61>s child-window ID.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to create a Windows menu bar, a child window,
|
||||
// and associate it with the CXTToolBar object. It also sets the menu bar
|
||||
// height to a default value.
|
||||
//
|
||||
// Use CreateEx, instead of Create, when certain styles need to be present
|
||||
// during the creation of the embedded menu bar control. For example, set
|
||||
// 'dwCtrlStyle' to TBSTYLE_FLAT | TBSTYLE_TRANSPARENT to create a menu bar
|
||||
// that resembles the Internet Explorer 4 menu bars.
|
||||
virtual BOOL CreateEx(CWnd* pParentWnd,DWORD dwUnused = 0,DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP,CRect rcBorders = CRect(0, 0, 0, 0),UINT nID = AFX_IDW_MENUBAR);
|
||||
|
||||
// Input: nElapse - Specifies the time-out value, in milliseconds.
|
||||
// nIDEvent - Specifies a nonzero timer identifier.
|
||||
// Summary: This member function will set the timer identifier and time-out value
|
||||
// for the cool menu. The timer is activated when the mouse hovers over a
|
||||
// menu bar button when using intelligent menus. NOTE: You will need to also
|
||||
// call CXTCoolMenu::SetTimerInfo() if you are changing the 'nIDEvent' parameter.
|
||||
void SetTimerInfo(UINT nElapse,UINT nIDEvent=1000);
|
||||
|
||||
// Input: bStretchToFit - TRUE to stretch to fit the entire application area, FALSE to fit only
|
||||
// the area occupied by menu items.
|
||||
// Summary: Call this member function to enable the menu bar to occupy the entire
|
||||
// application area or size the menu bar to the area occupied by menu items
|
||||
// only.
|
||||
void SetStretchToFit(BOOL bStretchToFit);
|
||||
|
||||
// Returns: TRUE if the menu occupies the entire application area, or FALSE if it only
|
||||
// occupies the area the size of the menu items.
|
||||
// Summary: Call this member function to get the stretch state of the menu bar.
|
||||
BOOL GetStretchToFit();
|
||||
|
||||
// Input: bShowMDIButtons - TRUE to display MDI buttons, FALSE to hide them.
|
||||
// Summary: Call this member function to enable or disable rendering of the MDI buttons
|
||||
// when an MDI frame is maximized. Call this function after you have created
|
||||
// your menubar. The button layout will be automatically adjusted.
|
||||
void ShowMDIButtons(BOOL bShowMDIButtons);
|
||||
|
||||
// Returns: TRUE if the MDI buttons are rendered, otherwise returns FALSE.
|
||||
// Summary: This member function tells if MDI buttons are currently rendered.
|
||||
BOOL IsShowMDIButtons() const;
|
||||
|
||||
// Input: nCommandID - The command ID of a menu item to hide.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified command to the list of
|
||||
// menu items to hide until activated by clicking on the chevron.
|
||||
virtual BOOL HideCommand(UINT nCommandID);
|
||||
|
||||
// Input: nCommandIDs - An array of command IDs, of menu items, to hide.
|
||||
// nSize - Size of the array passed in.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified commands to the list of
|
||||
// menu items to hide until activated by clicking on the chevron.
|
||||
virtual BOOL HideCommands(const UINT* nCommandIDs,int nSize);
|
||||
|
||||
// Input: pObject - Represents a valid CObject pointer.
|
||||
// Returns: TRUE if the object passed in is a CXTMenuBar object, otherwise returns FALSE.
|
||||
// Summary: This function checks if the object passed in as 'pObject' is a CXTMenuBar
|
||||
// object.
|
||||
static BOOL IsMenuBar(CObject* pObject);
|
||||
|
||||
// Returns: TRUE if the active MDI frame is maximized, otherwise returns FALSE.
|
||||
// Summary: This function tells if the active MDI frame is currently maximized.
|
||||
BOOL IsMDIMaximized() const;
|
||||
|
||||
// Input: bEnable - true to show "More Windows", or false to hide.
|
||||
// Summary: Call this member function to enable or disable the "More Windows" menu
|
||||
// item that is displayed in the "Windows" pull down menu.
|
||||
void EnableMoreWindows(bool bEnable=true);
|
||||
|
||||
// Input: bSend - A reference to a valid BOOL value.
|
||||
// nMsg - Specifies the message to be sent.
|
||||
// wParam - Specifies additional message-specific information.
|
||||
// lParam - Specifies additional message-specific information.
|
||||
// Returns: An HWND data type that represents the window handle.
|
||||
// Summary: This menu function is called to determine the window handle for command
|
||||
// routing.
|
||||
HWND OleMenuDescriptor(BOOL& bSend,UINT nMsg,WPARAM wParam,LPARAM lParam);
|
||||
|
||||
// Returns: A pointer to a valid CFrameWnd object.
|
||||
// Summary: This member function returns a pointer to the menu bar owner frame.
|
||||
CFrameWnd* GetOwnerFrame();
|
||||
|
||||
// Returns: A pointer to a valid COleDocument object.
|
||||
// Summary: This member function returns a pointer to the OLE document that sent
|
||||
// the last command if the menu bar is used with an OLE framework.
|
||||
COleDocument* GetCmdSentOleDoc();
|
||||
|
||||
// Returns: A pointer to a valid CWnd object.
|
||||
// Summary: This member function returns a pointer to the OLE window that sent
|
||||
// the last command if the menu bar is used with an OLE framework.
|
||||
CWnd* GetCmdSentOleWnd();
|
||||
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function is called to fill the routing map for the OLE
|
||||
// framework.
|
||||
BOOL FillCommandRoutingMap();
|
||||
|
||||
protected:
|
||||
|
||||
// Input: rcButton - A reference to a valid CRect object that represents the size of the
|
||||
// button.
|
||||
// tpm - Reference to a TPMPARAMS struct.
|
||||
// nFlags - A reference to TrackPopupMenu flags
|
||||
// Returns: A CPoint object.
|
||||
// Summary: This member function will insure the menu always appears inside the
|
||||
// window. It will, given a button rectangle, compute point and "exclude
|
||||
// rect" for TrackPopupMenu, based on the current docking style, so that
|
||||
// the menu will always appear inside the window.
|
||||
virtual CPoint ComputeMenuTrackPoint(const CRect& rcButton, TPMPARAMS& tpm, UINT &nFlags);
|
||||
|
||||
// Summary: This member function initializes an MDI "Window" menu by adding names
|
||||
// of all the MDI children. This duplicates what the default handler
|
||||
// for WM_MDISETMENU does, but it is necessary to reinvent the wheel since
|
||||
// menu bars manage the menus themselves. This function is called when
|
||||
// the frame gets WM_INITMENUPOPUP.
|
||||
virtual void OnInitWindowMenu();
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: message - Message identifier.
|
||||
// nFlags - Indicates whether various virtual keys are down. This parameter
|
||||
// can be any combination of the following values:
|
||||
// [ul]
|
||||
// [li]<b>MK_CONTROL</b> Set if the CTRL key is down.[/li]
|
||||
// [li]<b>MK_LBUTTON</b> Set if the left mouse button is down.[/li]
|
||||
// [li]<b>MK_MBUTTON</b> Set if the middle mouse button is down.[/li]
|
||||
// [li]<b>MK_RBUTTON</b> Set if the right mouse button is down.[/li]
|
||||
// [li]<b>MK_SHIFT</b> Set if the SHIFT key is down.[/li]
|
||||
// [/ul]
|
||||
// pt - Specifies the x- and y-coordinate of the cursor. These coordinates
|
||||
// are always relative to the upper-left corner of the window.
|
||||
// Returns: TRUE if handled; i.e., caller should eat the mouse message.
|
||||
// Summary: Call this member function to handle a mouse message. It looks for
|
||||
// a click on one of the buttons.
|
||||
virtual BOOL OnMouseMessage(UINT message,UINT nFlags,CPoint pt);
|
||||
|
||||
// Summary: This member function makes the frame recalculate the control bar sizes
|
||||
// after a menu change.
|
||||
void DoLayout();
|
||||
|
||||
// Input: iButton - Index of the starting button.
|
||||
// bPrev - TRUE to search for the previous button. FALSE to search for the next
|
||||
// button.
|
||||
// Returns: The index of the previous, or next, button found.
|
||||
// Summary: This member function gets the button index of the button before, or
|
||||
// after, a given button specified by 'iButton'.
|
||||
int GetNextOrPrevButton(int iButton,BOOL bPrev) const;
|
||||
|
||||
// Input: iState - Passed in XT_TRACT_STATE structure.
|
||||
// iButton - Index of the button to set the state for.
|
||||
// Summary: This member function sets the tracking state for a button to either none,
|
||||
// button, or popup.
|
||||
void SetTrackingState(XT_TRACK_STATE iState,int iButton=-1);
|
||||
|
||||
// Input: iButton - The index of the button item to make hot.
|
||||
// Summary: This member function sets an 'iButton' item as hot-selected.
|
||||
void SetHotItem(int iButton);
|
||||
|
||||
// Input: iButton - The index of the button item to depress.
|
||||
// Summary: This member function makes an 'iButton' item appear pressed. Pass in
|
||||
// -1 to release all buttons.
|
||||
void PressItem(int iButton);
|
||||
|
||||
// Input: pItem - A pointer to a valid CXTMenuBarItem object.
|
||||
// Returns: The index of the item, or -1 if the item is not found.
|
||||
// Summary: This member function searches for a CXTMenuBarItem object.
|
||||
int FindItem(CXTMenuBarItem* pItem);
|
||||
|
||||
// Input: iButton - Index of the button to track.
|
||||
// Summary: This member function tracks the popup submenu associated with the active
|
||||
// button in the menu bar. This function actually goes into a loop, tracking
|
||||
// different menus until the user selects a command or exits the menu.
|
||||
void TrackPopup(int iButton);
|
||||
|
||||
// Input: pt - Specifies the x- and y-coordinate of the cursor. These coordinates
|
||||
// are always relative to the upper-left corner of the window.
|
||||
// itemsBegin - Pointer to the first entry in an array of item indices that need to be
|
||||
// checked.
|
||||
// itemsEnd - Pointer past the last entry in an array of item indices that need
|
||||
// to be checked.
|
||||
// Returns: The index of the item that contains 'pt', or -1 if there was no match.
|
||||
// Summary: This member function determines which menu bar item, within the range of
|
||||
// 'itemsBegin' to 'itemsEnd', a point is in ('pt' in client coordinates).
|
||||
virtual int HitTest(CPoint pt,int* itemsBegin,int* itemsEnd) const;
|
||||
|
||||
// Summary: This member function toggles the state from home state to button-tracking,
|
||||
// and back.
|
||||
void ToggleTrackButtonMode();
|
||||
|
||||
// Input: iButton - Index of the new popup to track, or -1 to quit tracking.
|
||||
// Summary: This member function cancels the current popup menu by posting WM_CANCELMODE,
|
||||
// and tracks a new menu.
|
||||
void CancelMenuAndTrackNewOne(int iButton);
|
||||
|
||||
// Input: hMenu - Handle to the menu.
|
||||
// nItemID - Menu item ID or submenu index of the item selected.
|
||||
// Summary: This member function is called by the menu bar when a user selects a
|
||||
// new menu item. This will determine if the selected item is a submenu
|
||||
// and or parent menu item. This way the menu bar knows whether the right
|
||||
// or left arrow key should move to the next menu popup.
|
||||
void OnMenuSelect(HMENU hMenu,UINT nItemID);
|
||||
|
||||
// Input: bDoLayout - Tells if the layout shall be recalculated if a change is detected.
|
||||
// Summary: This member function checks whether the MDI maximized state has changed.
|
||||
// If so, add or delete the min/max/close buttons to or from the menu bar.
|
||||
void CheckMinMaxState(bool bDoLayout);
|
||||
|
||||
// Input: iButton - Index of the button to check.
|
||||
// Returns: TRUE if it is a valid index, otherwise returns FALSE.
|
||||
// Summary: This member function is called to check to see if the button specified
|
||||
// by 'iButton' is a valid index.
|
||||
BOOL IsValidButton(int iButton) const;
|
||||
|
||||
// Input: m - A Reference to a valid tagMSG structure.
|
||||
// pWndMenu - A pointer to a valid CWnd object.
|
||||
// Returns: TRUE if message is handled (to eat it).
|
||||
// Summary: This member function handles a menu input event. It looks for a left
|
||||
// or right arrow key to change the popup menu, or mouse movement over
|
||||
// a different menu button for "hot" popup effect.
|
||||
virtual BOOL OnMenuInput(MSG& m,CWnd* pWndMenu = NULL);
|
||||
|
||||
// Input: bAltKey - true if the alt key was used to activate menu.
|
||||
// Summary: This member function is called to update the display for Windows 2000 menus.
|
||||
void UpdateDisplay(bool bAltKey);
|
||||
|
||||
// Returns: The window styles for the active MDI client window.
|
||||
// Summary: The control bar calls this method to return the window style for the
|
||||
// active MDI child.
|
||||
long GetMDIWindowStyle();
|
||||
|
||||
// Summary: This member function removes all menu bar items.
|
||||
void RemoveAll();
|
||||
|
||||
// Input: itemsBegin - Beginning of the buffer to store indices.
|
||||
// itemsEnd - Points past the last item in the buffer.
|
||||
// flags - OR'ed (|) combination of the ITEMTYPE_... flags.
|
||||
// Returns: A pointer past the last initialized buffer item.
|
||||
// Summary: This member function gets the indices of all the items currently visible.
|
||||
int* CXTMenuBar::GetItems(int* itemsBegin,int* itemsEnd,int flags) const;
|
||||
|
||||
// Input: pItem - A pointer to a valid CXTMenuBarItem object.
|
||||
// Returns: A CRect object that represents the item.
|
||||
// Summary: This member function computes the item rectangle, as per current menu bar
|
||||
// orientation.
|
||||
CRect GetItemRect(CXTMenuBarItem* pItem) const;
|
||||
|
||||
// Input: bHorz - true if horizontal border size is to be calculated.
|
||||
// Returns: A CSize object that represents the width and height of all the borders.
|
||||
// Summary: This member function computes the total width and height of all the
|
||||
// borders.
|
||||
CSize GetBorderSize(bool bHorz) const;
|
||||
|
||||
// Summary: This member function resets the state tracking variables.
|
||||
void ResetTrackingState();
|
||||
|
||||
// Returns: true to enable full window drag, or false to use the wire frame.
|
||||
// Summary: This member function tells if this menu bar shall be visualized when
|
||||
// dragging or if the system shall render it with a wire frame. Default
|
||||
// implementation uses full window drag.
|
||||
virtual bool IsFullWindowDrag();
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: pSize - [ul]
|
||||
// [li]<b>IN</b> Extent of the rectangle in which the hot spot must be defined.[/li]
|
||||
// [li]<b>OUT</b> Offset of the hot spot from the rect's top-left corner.[/li]
|
||||
// [/ul]
|
||||
// Returns: true if the menu bar defines a hot spot (the default) in which case a
|
||||
// buffer, pointed to by 'pSize', is filled with the hot spot offset from
|
||||
// the top-left corner. Returns false to indicate that no hot spot is defined.
|
||||
// Summary: This member function calculates the position of the menu bar hot spot,
|
||||
// i.e., the point that is used to pin the control bar rect to the mouse
|
||||
// cursor when dragging it.
|
||||
virtual bool GetHotSpot(LPSIZE pSize);
|
||||
|
||||
// Input: dwMenuPopupID - Popup menu ID
|
||||
// Returns: A menu popup by its CRC32-based ID
|
||||
// Summary: This member function returns a HMENU handle for the popup menu specified by dwMenuPopupID.
|
||||
HMENU GetMenuPopupByCrc(DWORD dwMenuPopupID);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTMenuBar)
|
||||
virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
|
||||
virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
|
||||
virtual CSize CalcDynamicLayout(int nLength, DWORD nMode);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual XT_TRACK_STATE GetTrackingState(int& iPopup);
|
||||
virtual void OnInitMenuPopup();
|
||||
virtual INT_PTR OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
|
||||
virtual void OnBarStyleChange(DWORD dwOldStyle, DWORD dwNewStyle);
|
||||
virtual bool HasCmdHandlers(CWnd* pWnd);
|
||||
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValid() const;
|
||||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTMenuBar)
|
||||
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint pt);
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
|
||||
afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
|
||||
afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
|
||||
afx_msg UINT OnNcHitTest(CPoint point);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnDestroy();
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
// Input: code - An integer value.
|
||||
// wParam - Specifies additional message-specific information.
|
||||
// lParam - Specifies additional message-specific information.
|
||||
// Returns: An LRESULT Object
|
||||
// Summary: Menu filter hook just passes to virtual CXTMenuBar function.
|
||||
static LRESULT CALLBACK MenuInputFilter(int code, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
// drawing helpers
|
||||
|
||||
void OnDrawIcon(CDC* pDC, CXTSysMenuBarItem* pItem);
|
||||
void OnDrawMenuItem(CDC* pDC, CXTSubMenuBarItem* pItem);
|
||||
void OnRenderControl(CDC* pDC, CXTControlMenuBarItem* pItem);
|
||||
void DrawMenuItemText(CDC* pDC, CRect& rcItem, CXTSubMenuBarItem* pItem, bool bHorz);
|
||||
void DrawVertText(CDC* pDC, CRect& rcItem, CXTSubMenuBarItem* pItem, COLORREF crText);
|
||||
void DrawHorzText(CDC* pDC, CRect& rcItem, CXTSubMenuBarItem* pItem);
|
||||
|
||||
// these track menu popups
|
||||
|
||||
void OnTrackSubMenu(CXTSubMenuBarItem* pItem);
|
||||
void OnTrackWindowMenu(CXTSysMenuBarItem* pItem);
|
||||
void OnDblClickWindowMenu(CXTSysMenuBarItem* pItem);
|
||||
|
||||
// Layout helpers
|
||||
|
||||
CSize CalcLayout(DWORD nMode, int nLength = -1);
|
||||
CSize CalcItemExtent(bool bHorz);
|
||||
int WrapMenuBar(int nWidth);
|
||||
void SizeMenuBar(int nLength, bool bHorz);
|
||||
void CalcItemLayout(bool bHorz);
|
||||
int GetClipBoxLength(bool bHorz);
|
||||
|
||||
// alignment (CBRS_ALIGN_...) with regard to floating status
|
||||
|
||||
DWORD GetAlignmentStyle() const;
|
||||
void DrawXPFrameControl(CDC* pDC, CRect& r, UINT uStyle, bool bHilite=false, bool bPushed=false);
|
||||
CFont& GetTextFont() const;
|
||||
CSize GetTextSize(CDC* pDC, CString strMenuText) const;
|
||||
TCHAR GetHotKey(LPCTSTR lpszMenuName) const;
|
||||
virtual void ActivateToolTips(CPoint point, UINT uState);
|
||||
|
||||
virtual BOOL IsFloating() const;
|
||||
virtual BOOL IsHorzDocked() const;
|
||||
|
||||
// Input: lp - Pointer to a rebar bar descriptor to use to fill in the sizing information.
|
||||
// bHorz - Tells if this control bar must be oriented horizontally.
|
||||
// Summary: This notification is called whenever this menu bar is added to a CXTReBar object.
|
||||
virtual bool OnAddedToRebar(REBARBANDINFO* lp,bool bHorz);
|
||||
|
||||
// Input: pInfo - Descriptor of the band
|
||||
// bHorz - Tells if horizontally oriented
|
||||
// Summary: Called whenever this menu bar is embedded in CXTReBar control
|
||||
// that has just resized the band in which this menu bar resides.
|
||||
virtual void OnRebarBandResized(XT_REBARSIZECHILDINFO* pInfo, bool bHorz);
|
||||
|
||||
// Input: bMode - True to enable customization.
|
||||
// Summary: Sets customization mode on/off.
|
||||
void SetCustMode(bool bMode);
|
||||
|
||||
// Returns: An RGB color value.
|
||||
// Summary: This member function is used to determine the correct background fill
|
||||
// color to be used during paint operations.
|
||||
virtual COLORREF GetBackgroundColor() const;
|
||||
|
||||
friend class CXTMenu;
|
||||
friend class CXTCustTools;
|
||||
friend class CXTMBarWndHook;
|
||||
friend class CXTToolsManager;
|
||||
friend class CXTMBarMDIWndHook;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE BOOL CXTMenuBar::IsValidButton(int iButton) const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return 0 <= iButton && iButton < m_arrItems.GetSize();
|
||||
}
|
||||
AFX_INLINE XT_TRACK_STATE CXTMenuBar::GetTrackingState(int& iPopup) {
|
||||
ASSERT(::IsWindow(m_hWnd)); iPopup = m_iPopupTracking; return m_iTrackingState;
|
||||
}
|
||||
AFX_INLINE CMenu* CXTMenuBar::GetMenu() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return CMenu::FromHandle(m_hMenu);
|
||||
}
|
||||
AFX_INLINE void CXTMenuBar::SetStretchToFit(BOOL bStretchToFit) {
|
||||
m_bStretchToFit = (bStretchToFit != 0);
|
||||
}
|
||||
AFX_INLINE BOOL CXTMenuBar::GetStretchToFit() {
|
||||
return m_bStretchToFit;
|
||||
}
|
||||
AFX_INLINE void CXTMenuBar::ShowMDIButtons(BOOL bShowMDIButtons) {
|
||||
ASSERT(::IsWindow(m_hWnd)); m_bShowMDIButtons = (bShowMDIButtons != 0); DoLayout();
|
||||
}
|
||||
AFX_INLINE BOOL CXTMenuBar::IsShowMDIButtons() const {
|
||||
return m_bShowMDIButtons;
|
||||
}
|
||||
AFX_INLINE BOOL CXTMenuBar::IsMenuBar(CObject* pObject) {
|
||||
return pObject->IsKindOf(RUNTIME_CLASS(CXTMenuBar));
|
||||
}
|
||||
AFX_INLINE void CXTMenuBar::EnableMoreWindows(bool bEnable/*=true*/) {
|
||||
m_bMoreWindows = bEnable;
|
||||
}
|
||||
AFX_INLINE BOOL CXTMenuBar::IsMDIMaximized() const {
|
||||
return m_bMDIMaximized;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTMENUBAR_H__)
|
||||
111
Editor/XT/Include/XTMiniDockFrameWnd.h
Normal file
111
Editor/XT/Include/XTMiniDockFrameWnd.h
Normal file
@@ -0,0 +1,111 @@
|
||||
// XTMiniDockFrameWnd.h interface for the CXTMiniDockFrameWnd class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTMINIDOCKFRAMEWND_H__)
|
||||
#define __XTMINIDOCKFRAMEWND_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
// forwards
|
||||
|
||||
class CXTDockBar;
|
||||
class CXTControlBar;
|
||||
class CXTDockContext;
|
||||
class CXTFrameButton;
|
||||
class CXTExpMenuWnd;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTMiniDockFrameWnd is a CMiniDockFrameWnd class. It is used to
|
||||
// handle docking for the CXTDockWindow class.
|
||||
class _XT_EXT_CLASS CXTMiniDockFrameWnd : public CMiniDockFrameWnd
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTMiniDockFrameWnd)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTMiniDockFrameWnd object.
|
||||
CXTMiniDockFrameWnd();
|
||||
|
||||
// Summary: Destroys a CXTMiniDockFrameWnd object, handles cleanup and de-allocation.
|
||||
virtual ~CXTMiniDockFrameWnd();
|
||||
|
||||
protected:
|
||||
|
||||
// Summary: Appearance as most recently rendered
|
||||
enum APPEARANCE_STYLE
|
||||
{
|
||||
APPEARANCE_UNDEFINED, // Undefined style
|
||||
APPEARANCE_XPSTYLE, // Office xp style.
|
||||
APPEARANCE_CLASSIC, // Classic Windows style.
|
||||
} m_currentAppearance;
|
||||
|
||||
// Returns: An APPEARANCE_STYLE enumeration.
|
||||
// Summary: Prescribed current appearance
|
||||
static APPEARANCE_STYLE GetCurrentAppearance();
|
||||
|
||||
bool m_bInitCompleted; // Tells if initial update completed
|
||||
CPtrList m_arrButtons; // Frame button array
|
||||
CImageList m_imageList; // Image list used by mini-frame buttons.
|
||||
CToolTipCtrl m_toolTip; // Button tooltip control.
|
||||
CXTExpMenuWnd* m_pPopupWnd; // Customize popup window.
|
||||
CXTFrameButton* m_pPressedBtn; // Points to the active frame button.
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTMiniDockFrameWnd)
|
||||
public:
|
||||
virtual BOOL Create(CWnd* pParent, DWORD dwBarStyle);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual bool IsValidBar(CControlBar* pBar) const;
|
||||
virtual bool IsControlBar(CControlBar* pBar) const;
|
||||
virtual bool IsToolbar(CControlBar* pBar) const;
|
||||
virtual bool IsMenubar(CControlBar* pBar) const;
|
||||
virtual bool IsDockWindow(CControlBar* pBar) const;
|
||||
virtual CXTDockBar* GetXTDockBar() const;
|
||||
virtual CXTControlBar* GetXTControlBar() const;
|
||||
virtual CXTDockContext* GetXTDockContext(CControlBar* pBar) const;
|
||||
virtual void DrawXPFrameControl(CDC* pDC, CRect& r, CXTFrameButton* pFrameButton);
|
||||
virtual void ActivateToolTips(CPoint point, bool bIsCloseButton);
|
||||
virtual void CalcWindowRect(LPRECT lpClientRect, UINT nAdjustType = adjustBorder);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTMiniDockFrameWnd)
|
||||
afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
|
||||
afx_msg void OnNcLButtonDblClk(UINT nHitTest, CPoint point);
|
||||
afx_msg void OnNcPaint();
|
||||
afx_msg BOOL OnNcActivate(BOOL bActive);
|
||||
afx_msg void OnIdleUpdateCmdUI();
|
||||
afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point);
|
||||
afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point);
|
||||
afx_msg void OnCustomize();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnInitMiniFrame(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnSetText(WPARAM, LPARAM);
|
||||
afx_msg void OnPopupClosed();
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
friend class CDockBar;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTMINIDOCKFRAMEWND_H__)
|
||||
69
Editor/XT/Include/XTNewToolbarDlg.h
Normal file
69
Editor/XT/Include/XTNewToolbarDlg.h
Normal file
@@ -0,0 +1,69 @@
|
||||
// XTNewToolbarDlg.h interface for the CXTNewToolbarDlg class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTNEWTOOLBARDLG_H__)
|
||||
#define __XTNEWTOOLBARDLG_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTNewToolbarDlg is a multiple inheritance class derived from CXTDialogState
|
||||
// and CDialog. CXTNewToolbarDlg is used to create the customize dialog
|
||||
// that is used during toolbar customization.
|
||||
class _XT_EXT_CLASS CXTNewToolbarDlg : CXTDialogState, public CDialog
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
// Input: pWndParent - Points to the top-level frame window.
|
||||
// Summary: Constructs a CXTNewToolbarDlg object.
|
||||
CXTNewToolbarDlg(CFrameWnd* pWndParent=NULL);
|
||||
|
||||
//{{AFX_DATA(CXTNewToolbarDlg)
|
||||
|
||||
enum { IDD = XT_IDD_NEWTOOLBAR };
|
||||
CXTEdit m_editToolbar;
|
||||
CString m_strToolbar;
|
||||
//}}AFX_DATA
|
||||
|
||||
int m_nNewID; // ID for a newly created toolbar.
|
||||
CString m_strExistingName; // A NULL terminated string that represents the toolbar name.
|
||||
CFrameWnd* m_pFrameWnd; // Pointer to the top-level frame window.
|
||||
|
||||
// Summary: This member function is called by the dialog to determine the next
|
||||
// available suggested name to be displayed in the new toolbar dialog.
|
||||
void SetSuggestedName();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTNewToolbarDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTNewToolbarDlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
virtual void OnOK();
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTNEWTOOLBARDLG_H__)
|
||||
176
Editor/XT/Include/XTOSVersionInfo.h
Normal file
176
Editor/XT/Include/XTOSVersionInfo.h
Normal file
@@ -0,0 +1,176 @@
|
||||
// XTOSVersionInfo.h: interface for the CXTOSVersionInfo class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTOSVERSIONINFO_H__)
|
||||
#define __XTOSVERSIONINFO_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTOSVersionInfo is a OSVERSIONINFO derived class. This class wraps
|
||||
// the Win32 API GetVersionEx(...), used to get the current Windows OS
|
||||
// version. CXTOSVersionInfo is a single instance, or "singleton" object,
|
||||
// that is accessed with the Get() method.
|
||||
class _XT_EXT_CLASS CXTOSVersionInfo : public OSVERSIONINFO
|
||||
{
|
||||
public:
|
||||
|
||||
// Example: <pre>bool bIsWinNT = CXTOSVersionInfo::Get().IsWinNT4();</pre>
|
||||
// Summary: Call this member function to access the class members. Since this
|
||||
// class is designed as a single instance object you can only access version
|
||||
// info thru this static method. You <b>cannot</b> directly instantiate an object
|
||||
// of type CXTOSVersionInfo.
|
||||
static CXTOSVersionInfo &Get();
|
||||
|
||||
// Returns: true if the OS is Windows 3.1, otherwise returns false.
|
||||
// Summary: Call this member function to check to see if the operating system is
|
||||
// Windows 3.1.
|
||||
bool IsWin31() const;
|
||||
|
||||
// Returns: true if the OS is Windows 95, otherwise returns false.
|
||||
// Summary: Call this member function to check to see if the operating system is
|
||||
// Windows 95.
|
||||
bool IsWin95() const;
|
||||
|
||||
// Returns: true if the OS is Windows 98, otherwise returns false.
|
||||
// Summary: Call this member function to check to see if the operating system is
|
||||
// Windows 98.
|
||||
bool IsWin98() const;
|
||||
|
||||
// Returns: true if the OS is Windows ME, otherwise returns false.
|
||||
// Summary: Call this member function to check to see if the operating system is
|
||||
// Windows ME.
|
||||
bool IsWinME() const;
|
||||
|
||||
// Returns: true if the OS is Windows NT 4, otherwise returns false.
|
||||
// Summary: Call this member function to check to see if the operating system is
|
||||
// Windows NT 4.
|
||||
bool IsWinNT4() const;
|
||||
|
||||
// Returns: true if the OS is Windows 2000, otherwise returns false.
|
||||
// Summary: Call this member function to check to see if the operating system is
|
||||
// Windows 2000.
|
||||
bool IsWin2K() const;
|
||||
|
||||
// Returns: true if the OS is Windows XP, otherwise returns false.
|
||||
// Summary: Call this member function to check to see if the operating system is
|
||||
// Windows XP.
|
||||
bool IsWinXP() const;
|
||||
|
||||
// Returns: true if the OS is greater than or equal to Windows 3.1, otherwise returns
|
||||
// false.
|
||||
// Summary: Call this member function to check to see if the operating system is
|
||||
// greater than or equal to Windows 3.1.
|
||||
bool IsWin31OrGreater() const;
|
||||
|
||||
// Returns: true if the OS is of the Windows 9x family, and is Windows 95 or
|
||||
// a later version, otherwise returns false.
|
||||
// Summary: Call this member function to check to see if the operating system is
|
||||
// of the Windows 9x family, and is Windows 95 or a later version.
|
||||
bool IsWin95OrGreater() const;
|
||||
|
||||
// Returns: true if the OS is of the Windows 9x family, and is Windows 98 or
|
||||
// a later version, otherwise returns false.
|
||||
// Summary: Call this member function to check to see if the operating system is
|
||||
// of the Windows 9x family, and is Windows 98 or a later version.
|
||||
bool IsWin98OrGreater() const;
|
||||
|
||||
// Returns: true if the OS is of the Windows 9x family, and is Windows ME or
|
||||
// a later version, otherwise returns false.
|
||||
// Summary: Call this member function to check to see if the operating system is
|
||||
// of the Windows 9x family, and is Windows ME or a later version.
|
||||
bool IsWinMEOrGreater() const;
|
||||
|
||||
// Returns: true if the OS is of the Windows NT family, and is Windows NT 4 or
|
||||
// a later version, otherwise returns false.
|
||||
// Summary: Call this member function to check to see if the operating system is
|
||||
// of the Windows NT family, and is Windows NT 4 or a later version.
|
||||
bool IsWinNT4OrGreater() const;
|
||||
|
||||
// Returns: true if the OS is of the Windows NT family, and is Windows 2000 or
|
||||
// a later version, otherwise returns false.
|
||||
// Summary: Call this member function to check to see if the operating system is
|
||||
// of the Windows NT family, and is Windows 2000 or a later version.
|
||||
bool IsWin2KOrGreater() const;
|
||||
|
||||
// Returns: true if the OS is of the Windows NT family, and is Windows XP or
|
||||
// a later version, otherwise returns false.
|
||||
// Summary: Call this member function to check to see if the operating system is
|
||||
// of the Windows NT family, and is Windows XP or a later version.
|
||||
bool IsWinXPOrGreater() const;
|
||||
|
||||
private:
|
||||
|
||||
// greater or equal a version number
|
||||
|
||||
inline bool gte_ver(const DWORD maj, const DWORD min) const;
|
||||
|
||||
inline bool eq_ver(const DWORD maj, const DWORD min) const;
|
||||
|
||||
// Constructs a CXTOSVersionInfo object.
|
||||
CXTOSVersionInfo();
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE bool CXTOSVersionInfo::IsWin31() const {
|
||||
return (dwPlatformId == VER_PLATFORM_WIN32s);
|
||||
}
|
||||
AFX_INLINE bool CXTOSVersionInfo::IsWin95() const {
|
||||
return (dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) && (dwMajorVersion == 4) && (dwMinorVersion < 10);
|
||||
}
|
||||
AFX_INLINE bool CXTOSVersionInfo::IsWin98() const {
|
||||
return (dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) && eq_ver(4, 10);
|
||||
}
|
||||
AFX_INLINE bool CXTOSVersionInfo::IsWinME() const {
|
||||
return (dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) && eq_ver(4, 90);
|
||||
}
|
||||
AFX_INLINE bool CXTOSVersionInfo::IsWinNT4() const {
|
||||
return (dwPlatformId == VER_PLATFORM_WIN32_NT) && eq_ver(4, 0);
|
||||
}
|
||||
AFX_INLINE bool CXTOSVersionInfo::IsWin2K() const {
|
||||
return (dwPlatformId == VER_PLATFORM_WIN32_NT) && eq_ver(5, 0);
|
||||
}
|
||||
AFX_INLINE bool CXTOSVersionInfo::IsWinXP() const {
|
||||
return (dwPlatformId == VER_PLATFORM_WIN32_NT) && eq_ver(5, 1);
|
||||
}
|
||||
AFX_INLINE bool CXTOSVersionInfo::IsWin95OrGreater() const {
|
||||
return (dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) && (dwMajorVersion >= 4);
|
||||
}
|
||||
AFX_INLINE bool CXTOSVersionInfo::IsWin98OrGreater() const {
|
||||
return (dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) && gte_ver(4, 10);
|
||||
}
|
||||
AFX_INLINE bool CXTOSVersionInfo::IsWinMEOrGreater() const {
|
||||
return (dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) && gte_ver(4, 90);
|
||||
}
|
||||
AFX_INLINE bool CXTOSVersionInfo::IsWinNT4OrGreater() const {
|
||||
return (dwPlatformId >= VER_PLATFORM_WIN32_NT) && (dwMajorVersion >= 4);
|
||||
}
|
||||
AFX_INLINE bool CXTOSVersionInfo::IsWin2KOrGreater() const {
|
||||
return (dwPlatformId >= VER_PLATFORM_WIN32_NT) && (dwMajorVersion >= 5);
|
||||
}
|
||||
AFX_INLINE bool CXTOSVersionInfo::IsWinXPOrGreater() const {
|
||||
return (dwPlatformId >= VER_PLATFORM_WIN32_NT) && gte_ver(5, 1);
|
||||
}
|
||||
AFX_INLINE bool CXTOSVersionInfo::gte_ver(const DWORD maj, const DWORD min) const {
|
||||
return (dwMajorVersion > maj) || (dwMajorVersion == maj && dwMinorVersion >= min);
|
||||
}
|
||||
AFX_INLINE bool CXTOSVersionInfo::eq_ver(const DWORD maj, const DWORD min) const {
|
||||
return (dwMajorVersion == maj) && (dwMinorVersion == min);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // !defined(__XTOSVERSIONINFO_H__)
|
||||
297
Editor/XT/Include/XTOleIPFrameWnd.h
Normal file
297
Editor/XT/Include/XTOleIPFrameWnd.h
Normal file
@@ -0,0 +1,297 @@
|
||||
// XTOleIPFrameWnd.h interface for the CXTOleIPFrameWnd class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTOLEIPFRAMEWND_H__)
|
||||
#define __XTOLEIPFRAMEWND_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
// forwards
|
||||
|
||||
class CXTDockState;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTOleIPFrameWnd is a multiple inheritance class derived from COleIPFrameWnd
|
||||
// and CXTFrameImpl. CXTOleIPFrameWnd extends the standard COleIPFrameWnd
|
||||
// class to allow CXTDockWindow and CXTToolBar docking, customization and
|
||||
// cool menu support.
|
||||
class _XT_EXT_CLASS CXTOleIPFrameWnd : public COleIPFrameWnd, public CXTFrameImpl
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTOleIPFrameWnd)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTOleIPFrameWnd object.
|
||||
CXTOleIPFrameWnd();
|
||||
|
||||
// Summary: Destroys a CXTOleIPFrameWnd object, handles cleanup and de-allocation.
|
||||
virtual ~CXTOleIPFrameWnd();
|
||||
|
||||
protected:
|
||||
|
||||
public:
|
||||
|
||||
// Returns: A CXTCoolMenu pointer that represents the cool menu object associated with
|
||||
// the frame.
|
||||
// Summary: This member function gets a pointer to the cool menu object associated
|
||||
// with the frame.
|
||||
CXTCoolMenu* GetCoolMenu();
|
||||
|
||||
// Returns: A CXTMenuBar pointer that represents the menu bar associated with the frame.
|
||||
// Summary: This member function gets a pointer to the menu bar associated with
|
||||
// the frame.
|
||||
CXTMenuBar* GetMenuBar();
|
||||
|
||||
// Input: nIDToolBars - Array of toolbar resource IDs. The cool menu will use the toolbar
|
||||
// commands to map the icons placed next to the corresponding menu commands.
|
||||
// nSize - Size of the array of toolbars.
|
||||
// Summary: Call this member function to install cool menus for your application.
|
||||
// Cool menus are menus that appear with icons next to the menu titles.
|
||||
// Pass in your toolbar resource array to initialize.
|
||||
void InstallCoolMenus(const UINT* nIDToolBars,int nSize);
|
||||
|
||||
// Input: nIDToolBar - Toolbar resource ID. The cool menu will use the toolbar commands
|
||||
// to map the icons placed next to the corresponding menu commands.
|
||||
// Summary: Call this member function to install cool menus for your application.
|
||||
// Cool menus are menus that appear with icons next to the menu titles.
|
||||
// Pass in your toolbar resource to initialize.
|
||||
void InstallCoolMenus(const UINT nIDToolBar);
|
||||
|
||||
// Input: lpszProfileName - Name of a section in the initialization file or a key in the
|
||||
// Windows registry where state information is stored.
|
||||
// Summary: This member function is called by the frame window to restore the
|
||||
// settings of the control bar.
|
||||
virtual void LoadBarState(LPCTSTR lpszProfileName);
|
||||
|
||||
// Input: lpszProfileName - Name of a section in the initialization file or a key in the
|
||||
// Windows registry where state information is stored.
|
||||
// Summary: This member function is called by the frame window to save the
|
||||
// settings of the control bar.
|
||||
virtual void SaveBarState(LPCTSTR lpszProfileName) const;
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwDockStyle - Specifies whether the control bar supports docking and the sides
|
||||
// of its parent window to which the control bar can be docked, if supported.
|
||||
// The style can be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_ALIGN_TOP</b> Allows docking at the top of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_BOTTOM</b> Allows docking at the bottom of
|
||||
// the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_LEFT</b> Allows docking on the left side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_RIGHT</b> Allows docking on the right side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_ANY</b> Allows docking on any side of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_FLOAT_MULTI</b> Allows multiple control bars to
|
||||
// be floated in a single mini-frame window.[/li]
|
||||
// [/ul]
|
||||
// If 0 (that is, indicating no flags), the control
|
||||
// bar will not dock.
|
||||
// Summary: Call this function to enable a control bar to be docked. The sides
|
||||
// specified must match one of the sides enabled for docking in the destination
|
||||
// frame window, or the control bar cannot be docked to that frame window.
|
||||
void EnableDocking(DWORD dwDockStyle);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwDockStyle - Specifies whether the control bar supports docking and the sides
|
||||
// of its parent window to which the control bar can be docked, if supported.
|
||||
// The style can be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_ALIGN_TOP</b> Allows docking at the top of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_BOTTOM</b> Allows docking at the bottom of
|
||||
// the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_LEFT</b> Allows docking on the left side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_RIGHT</b> Allows docking on the right side
|
||||
// of the client area.[/li]
|
||||
// [li]<b>CBRS_ALIGN_ANY</b> Allows docking on any side of the
|
||||
// client area.[/li]
|
||||
// [li]<b>CBRS_FLOAT_MULTI</b> Allows multiple control bars to
|
||||
// be floated in a single mini-frame window.[/li]
|
||||
// [/ul]
|
||||
// If 0 (that is, indicating no flags), the control
|
||||
// bar will not dock.
|
||||
// dwFlatStyle - Specifies the splitters, inside dockbars, look. It can be one
|
||||
// of the following:
|
||||
// [ul]
|
||||
// [li]<b>CBRS_XT_NONFLAT</b> Thick devstudio like non-flat splitters.[/li]
|
||||
// [li]<b>CBRS_XT_SEMIFLAT</b> Thin 3D non-flat splitters.[/li]
|
||||
// [li]<b>CBRS_XT_FLAT</b> Flat splitters.[/li]
|
||||
// [/ul]
|
||||
// Summary: Call this function to enable a control bar to be docked. The sides
|
||||
// specified must match one of the sides enabled for docking in the destination
|
||||
// frame window, or the control bar cannot be docked to that frame window.
|
||||
void EnableDockingEx(DWORD dwDockStyle,DWORD dwFlatStyle);
|
||||
|
||||
// Input: pBar - A CControlBar pointer to the control bar to be docked.
|
||||
// pDockBar - A CDockBar pointer to the dockbar the control bar is docked to.
|
||||
// lpRect - Determines, in screen coordinates, where the control bar will
|
||||
// be docked in the non-client area of the destination frame window.
|
||||
// Summary: This member function causes a control bar to be docked to the frame
|
||||
// window. The control bar will be docked to one of the sides of the frame
|
||||
// window specified in the calls to both CXTDockWindow::EnableDocking and
|
||||
// CXTFrameWnd::EnableDocking. The side chosen is determined by the
|
||||
// dockbar specified by 'pDockBar'.
|
||||
void DockControlBar(CControlBar* pBar,CDockBar* pDockBar,LPCRECT lpRect = NULL);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: pBar - A CControlBar pointer to the control bar to be docked.
|
||||
// nDockBarID - Determines which sides of the frame window to consider for docking.
|
||||
// It can be 0, or one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_TOP</b> Dock to the top side of the
|
||||
// frame window.[/li]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_BOTTOM</b> Dock to the bottom side of
|
||||
// the frame window.[/li]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_LEFT</b> Dock to the left side of the
|
||||
// frame window.[/li]
|
||||
// [li]<b>AFX_IDW_DOCKBAR_RIGHT</b> Dock to the right side of
|
||||
// the frame window.[/li]
|
||||
// [/ul]
|
||||
// If 0, the control bar can be docked to any side enabled for
|
||||
// docking in the destination frame window.
|
||||
// lpRect - Determines, in screen coordinates, where the control bar will
|
||||
// be docked in the non-client area of the destination frame window.
|
||||
// Summary: This member function causes a control bar to be docked to the frame
|
||||
// window. The control bar will be docked to one of the sides of the frame
|
||||
// window specified in the calls to both CXTDockWindow::EnableDocking and
|
||||
// CXTFrameWnd::EnableDocking. The side chosen is determined by
|
||||
// 'nDockBarID'.
|
||||
void DockControlBar(CControlBar* pBar,UINT nDockBarID = 0,LPCRECT lpRect = NULL);
|
||||
|
||||
// Input: pBar1 - A CControlBar pointer to the control bar to be docked.
|
||||
// pBar2 - A CControlBar pointer to the already docked control bar to be
|
||||
// redocked on the left of 'pBar1'.
|
||||
// Summary: This member function will redock a control bar specified by 'pBar2'
|
||||
// to the left of a newly docked control bar specified by 'pBar1'.
|
||||
virtual void DockControlBarLeftOf(CControlBar* pBar1,CControlBar* pBar2);
|
||||
|
||||
// Returns: A pointer to a CMenu object that represents the active menu for the frame.
|
||||
// Summary: This member function retrieves a pointer to the menu for the frame window.
|
||||
virtual CMenu* GetMenu() const;
|
||||
|
||||
// Input: nCommandID - The command ID of a menu item to hide.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified command to the list of
|
||||
// menu items to hide until activated by clicking on the chevron.
|
||||
virtual BOOL HideMenuItem(UINT nCommandID);
|
||||
|
||||
// Input: lpszItem - Text string representing the popup menu item to hide.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified menu item to the list of
|
||||
// menu items to hide until activated by clicking on the chevron.
|
||||
virtual BOOL HideMenuItem(LPCTSTR lpszItem);
|
||||
|
||||
// Input: nCommandIDs - An array of command IDs, of menu items, to hide.
|
||||
// nSize - Size of the array passed in.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified commands to the list of
|
||||
// menu items to hide until activated by clicking on the chevron.
|
||||
virtual BOOL HideMenuItems(const UINT* nCommandIDs,int nSize);
|
||||
|
||||
// Input: lpszItems - An array of command IDs, of menu items, to hide.
|
||||
// nSize - Size of the array passed in.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds the specified menu items to the list of
|
||||
// menu items to hide until activated by clicking on the chevron.
|
||||
virtual BOOL HideMenuItems(const LPCTSTR lpszItems,int nSize);
|
||||
|
||||
// Summary: This member function redraws the menu bar. If a menu bar is changed
|
||||
// by the window, call this function to draw the changed menu bar. Overrides
|
||||
// the CWnd implementation.
|
||||
void DrawMenuBarX();
|
||||
|
||||
// Summary: Call this function to display the Customize Toolbar dialog box.
|
||||
// This dialog box allows the user to customize the toolbar by adding
|
||||
// and deleting buttons.
|
||||
void Customize();
|
||||
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function will initialize the accelerator manager for the
|
||||
// framework.
|
||||
bool InitAccelManager();
|
||||
|
||||
// Input: iNormalIndex - Index where the 'Tools' menu should be inserted into the standard menu.
|
||||
// iWindowIndex - Index where the 'Tools' menu should be inserted into the MDI window menu.
|
||||
// iArgPopupMenu - Resource ID of the popup menu to be displayed for the Arguments
|
||||
// browse edit box.
|
||||
// iDirPopupMenu - Resource ID of the popup menu to be displayed for the Initial
|
||||
// Directory browse edit box.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to initialize the Tools manager for your
|
||||
// application. The Tools manager will insert a "Tools" menu into your
|
||||
// application's menu which allows the user to customize and add custom
|
||||
// commands the the menu. Typically used with toolbar customization,
|
||||
// the tools manager should be initialized when your frame is loaded by
|
||||
// overriding the virtual function CFrameWnd::LoadFrame and can be managed
|
||||
// by selecting the 'Tools' tab in the Customize dialog.
|
||||
bool InitToolsManager(int iNormalIndex,int iWindowIndex=-1,int iArgPopupMenu=0,int iDirPopupMenu=0);
|
||||
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this member function to initialize the Options manager for your
|
||||
// application. Typically used with toolbar customization, the Options
|
||||
// manager will allow the user to configure options related to the toolbar
|
||||
// and menu behavior for the application. The Options manager should
|
||||
// be initialized when your frame is loaded by overriding the virtual
|
||||
// function CFrameWnd::LoadFrame and can be managed by selecting the 'Options'
|
||||
// tab in the Customize dialog.
|
||||
bool InitOptionsManager();
|
||||
|
||||
protected:
|
||||
|
||||
virtual void SetDockState(const CXTDockState& state);
|
||||
virtual void GetDockState(CXTDockState& state) const;
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTOleIPFrameWnd)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs, UINT uIcon);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTOleIPFrameWnd)
|
||||
afx_msg void OnSysColorChange();
|
||||
afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
|
||||
afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg void OnCustomizeBar();
|
||||
afx_msg BOOL OnToolsManager(UINT nID);
|
||||
afx_msg void OnUpdateToolsManager(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateChevron(CCmdUI* pCmdUI);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTOleIPFrameWnd::Customize() {
|
||||
OnCustomizeBar();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTOLEIPFRAMEWND_H__)
|
||||
137
Editor/XT/Include/XTOptionsManager.h
Normal file
137
Editor/XT/Include/XTOptionsManager.h
Normal file
@@ -0,0 +1,137 @@
|
||||
// XTOptionsManager.h: interface for the CXTOptionsManager class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTOPTIONSMANAGER_H__)
|
||||
#define __XTOPTIONSMANAGER_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
// forwards
|
||||
|
||||
class CXTCoolMenu;
|
||||
class CXTAccelManager;
|
||||
class CXTToolsManager;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_OPTIONS is a stand alone structure class. It is used by CXTOptionsManager
|
||||
// to manage option data settings.
|
||||
struct XT_OPTIONS
|
||||
{
|
||||
int nAnimationType; // Animation type
|
||||
bool bToolBarVisualize; // true to render the toolbar while dragging or resizing.
|
||||
bool bMenuShadows; // true to use shadows under the menus.
|
||||
bool bMenuRecentCommands; // true to use intelligent menus to hide selected menu commands.
|
||||
bool bToolBarScreenTips; // true to show tooltips on toolbar commands.
|
||||
bool bShowFullAfterDelay; // true to display hidden menu commands after a short delay.
|
||||
bool bToolBarAccelTips; // true to add accelerator keys to toolbar tips.
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTOptionsManager is a stand alone class. It is used to create a CXTOptionsManager
|
||||
// object that is used to manage toolbar and menu options for the application.
|
||||
class CXTOptionsManager
|
||||
{
|
||||
private:
|
||||
|
||||
// Summary: Constructs a CXTOptionsManager object.
|
||||
CXTOptionsManager();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Destroys a CXTOptionsManager object, handles cleanup and de-allocation.
|
||||
virtual ~CXTOptionsManager();
|
||||
|
||||
protected:
|
||||
|
||||
bool m_bInitialized; // true if the options data has been initialized for the frame object.
|
||||
bool m_bAutoSave; // true if the options data is automatically saved when this class is destroyed.
|
||||
bool m_bChanged; // true if the contents of 'm_options' has been changed.
|
||||
bool m_bRemoveAll; // true if all options data is to be removed from the system registry.
|
||||
CFrameWnd* m_pFrameWnd; // Pointer to the frame window for the application.
|
||||
XT_OPTIONS m_options; // Option value structure.
|
||||
CXTCoolMenu* m_pCoolMenu; // Pointer to the cool menu manager for the frame specified by 'm_pFrameWnd'.
|
||||
|
||||
public:
|
||||
|
||||
// Returns: A reference to the one and only CXTOptionsManager object.
|
||||
// Example: <pre>CXTOptionsManager::Get().Init( this, GetCoolMenu() );</pre>
|
||||
// Summary: This static member function will retrieve a reference to the one
|
||||
// and only CXTOptionsManager object. You can use this function to access
|
||||
// data members for the CXTOptionsManager class.
|
||||
static CXTOptionsManager& Get();
|
||||
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function is called to save the options data to the system registry.
|
||||
bool Save();
|
||||
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function is called to load the options data from the system
|
||||
// registry.
|
||||
bool Load();
|
||||
|
||||
// Input: pFrameWnd - A pointer to a valid CFrameWnd object.
|
||||
// pCoolMenu - A pointer to a valid CXTCoolMenu object.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function is called to initialize the Options manager.
|
||||
// This function is called by the framework, usually from an overrode
|
||||
// LoadFrame handler.
|
||||
bool Init(CFrameWnd* pFrameWnd,CXTCoolMenu* pCoolMenu);
|
||||
|
||||
// Returns: true if it has been initialized, otherwise returns false.
|
||||
// Summary: This member function is called to determine if the Options manager
|
||||
// has been initialized.
|
||||
bool IsInitialized();
|
||||
|
||||
// Input: options - A reference to a valid XT_OPTIONS structure.
|
||||
// Summary: This member function is called to update the option data for the Options
|
||||
// manager.
|
||||
void SetOptions(XT_OPTIONS& options);
|
||||
|
||||
// Returns: A reference to an XT_OPTIONS structure.
|
||||
// Summary: This member function is called to return a reference to the options
|
||||
// data for the Options manager.
|
||||
XT_OPTIONS& GetOptions();
|
||||
|
||||
// Summary: This member function is called to reset the the cool menus usage data
|
||||
// for recently used commands. Calling this function will remove the list
|
||||
// of recently used commands for intelligent menus.
|
||||
void Reset();
|
||||
|
||||
protected:
|
||||
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function is called by the Options manager during load
|
||||
// operations.
|
||||
virtual bool OnLoad();
|
||||
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function is called by the Options manager during save
|
||||
// operations.
|
||||
virtual bool OnSave();
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE bool CXTOptionsManager::IsInitialized() {
|
||||
return m_bInitialized;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(__XTOPTIONSMANAGER_H__)
|
||||
951
Editor/XT/Include/XTOutBarCtrl.h
Normal file
951
Editor/XT/Include/XTOutBarCtrl.h
Normal file
@@ -0,0 +1,951 @@
|
||||
// XTOutBarCtrl.h interface for the CXTOutBarCtrl class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTOUTBARCTRL_H__)
|
||||
#define __XTOUTBARCTRL_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
// forwards
|
||||
|
||||
class CXTBarItem;
|
||||
class CXTBarFolder;
|
||||
class CXTEditItem;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTOutBarCtrl is a CWnd derived class. It is used to create a shortcut
|
||||
// bar window similar to the shortcut bar seen in Outlook™.
|
||||
class _XT_EXT_CLASS CXTOutBarCtrl : public CWnd
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTOutBarCtrl)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTOutBarCtrl object.
|
||||
CXTOutBarCtrl();
|
||||
|
||||
// Summary: Destroys a CXTOutBarCtrl object, handles cleanup and de-allocation.
|
||||
virtual ~CXTOutBarCtrl();
|
||||
|
||||
protected:
|
||||
|
||||
// used internally
|
||||
|
||||
int m_nFolderHeight;
|
||||
int m_nSelFolder;
|
||||
int m_nFolderHilighted;
|
||||
int m_nItemHilighted;
|
||||
int m_nLastFolderSelected;
|
||||
int m_nLastItemSelected;
|
||||
int m_nFirstItem;
|
||||
int m_nIconSpacingLarge;
|
||||
int m_nIconSpacingSmall;
|
||||
int m_nHitInternal1;
|
||||
int m_nHitInternal2;
|
||||
int m_nLastDragItemDraw;
|
||||
int m_nLastDragItemDrawType;
|
||||
int m_nSelAnimCount;
|
||||
int m_nSelAnimTiming;
|
||||
int m_nAnimationTickCount;
|
||||
CPen m_penBlack;
|
||||
BOOL m_bUpArrow;
|
||||
BOOL m_bDownArrow;
|
||||
BOOL m_bUpPressed;
|
||||
BOOL m_bDownPressed;
|
||||
BOOL m_bIconPressed;
|
||||
BOOL m_bLooping;
|
||||
BOOL m_bPressedHighlight;
|
||||
BOOL m_bUserClrBack;
|
||||
BOOL m_bUserClrText;
|
||||
CFont m_font;
|
||||
DWORD m_dwFlags;
|
||||
CRect m_rcUpArrow;
|
||||
CRect m_rcDownArrow;
|
||||
CSize m_sizeOffset;
|
||||
CSize m_sizeMargin;
|
||||
COLORREF m_clrBack;
|
||||
COLORREF m_clrText;
|
||||
CPtrArray m_arFolder;
|
||||
CImageList* m_pLargeImageList;
|
||||
CImageList* m_pSmallImageList;
|
||||
|
||||
// used internally
|
||||
|
||||
typedef enum { F_NORMAL, F_SELECT, F_HILIGHT } FOLDER_HILIGHT;
|
||||
|
||||
public:
|
||||
|
||||
// Input: iTime - Specifies the time, in milliseconds, that the selected item will animate.
|
||||
// Summary: Call this member function to set an animation effect for the currently
|
||||
// selected item. Not to be used with OBS_XT_SELHIGHLIGHT flag.
|
||||
virtual void SetAnimSelHighlight(const int iTime);
|
||||
|
||||
// Input: iFolder - The index of the folder to retrieve item data for. If -1, the currently
|
||||
// selected folder item data is returned.
|
||||
// Returns: A DWORD value.
|
||||
// Summary: Call this member function to retrieve the item data that was set for
|
||||
// the specified folder.
|
||||
virtual DWORD GetFolderData(int iFolder = -1);
|
||||
|
||||
// Input: iFolder - Index of the folder to retrieve the CWnd object for, if -1 the currently
|
||||
// selected folder CWnd object is used.
|
||||
// Returns: If 'iFolder' is -1, the child of the currently selected folder is returned.
|
||||
// If no object has been set for the folder, the return value is NULL.
|
||||
// Summary: Call this member function to retrieve the CWnd object that has been set
|
||||
// for the folder specified by 'iFolder'.
|
||||
virtual CWnd* GetFolderChild(int iFolder = -1);
|
||||
|
||||
// Input: lpszFolderName - Name of the folder to add.
|
||||
// pWndChild - Points to a valid CWnd object. The object must be created before
|
||||
// inserting.
|
||||
// dwData - Item data (lParam) for the folder.
|
||||
// Returns: The integer value that represents the index of the added folder.
|
||||
// Summary: Call this member function to add a folder with a CWnd child nested
|
||||
// inside of it. You can insert a folder with any CWnd object, such as
|
||||
// a tree control (see the OutlookBar sample).
|
||||
virtual int AddFolderBar(LPCTSTR lpszFolderName,CWnd* pWndChild,const DWORD dwData = 0);
|
||||
|
||||
// Input: iIndex - Index of the item to retrieve the text for.
|
||||
// Returns: A CString object containing the retrieved text.
|
||||
// Summary: Call this member function to get the text of the specified item for
|
||||
// the currently selected folder.
|
||||
virtual CString GetItemText(const int iIndex);
|
||||
|
||||
// Input: lValue - Specifies the time, in milliseconds, between animation. A value of
|
||||
// -1 will disable animation playback.
|
||||
// Summary: Call this member function to set the tick count, in milliseconds, between
|
||||
// each animation frame in folder scrolling. If you set a value of -1,
|
||||
// or minor, no animation will be played. Animation requires the OBS_XT_ANIMATION
|
||||
// flag be set.
|
||||
virtual void SetAnimationTickCount(const long lValue);
|
||||
|
||||
// Returns: An integer value representing the current tick count.
|
||||
// Summary: Call this member function to get the current animation tick count.
|
||||
virtual int GetAnimationTickCount();
|
||||
|
||||
// Input: iIndex - Index of the item in the currently selected folder.
|
||||
// iImage - Index of the image, in the image list, to use for the specified item.
|
||||
// Summary: Call this member function to set the image index, in the image list,
|
||||
// for the 'iIndex' item of the currently selected folder.
|
||||
virtual void SetItemImage(const int iIndex,const int iImage);
|
||||
|
||||
// Input: iIndex - Index of the item to set item data for.
|
||||
// dwData - Item data (lParam) to set.
|
||||
// Summary: Call this member function to set the item data (lParam) for the specified
|
||||
// item in the currently selected folder.
|
||||
virtual void SetItemData(const int iIndex,const DWORD dwData);
|
||||
|
||||
// Input: iIndex - Index of the item to retrieve the image index for.
|
||||
// Returns: An integer value that represents the index of the desired image.
|
||||
// Summary: Call this member function to retrieve the index of the image associated
|
||||
// with the specified item in the currently selected folder.
|
||||
virtual int GetItemImage(const int iIndex) const;
|
||||
|
||||
// Input: iIndex - Index of the item to retrieve item data for.
|
||||
// Returns: A DWORD value.
|
||||
// Summary: Call this member function to get the item data (lParam) for the specified
|
||||
// item in the currently selected folder.
|
||||
virtual DWORD GetItemData(const int iIndex) const;
|
||||
|
||||
// Input: iFolder - Index of the folder to insert the item into.
|
||||
// bNofify - true to send an XTWM_OUTBAR_NOTIFY message.
|
||||
// Summary: Call this member function to remove all items from the folder specified
|
||||
// by 'iFolder'.
|
||||
virtual void RemoveAllItems(int iFolder,bool bNofify=false);
|
||||
|
||||
// Input: iIndex - Index of the item to remove.
|
||||
// Summary: Call this member function to remove the specified item from the currently
|
||||
// selected folder.
|
||||
virtual void RemoveItem(const int iIndex);
|
||||
|
||||
// Input: iIndex - Index of the item to set the text for.
|
||||
// lpszItemName - Points to a NULL terminated string.
|
||||
// Summary: Call this member function to set the text for the specified item in the
|
||||
// currently selected folder.
|
||||
virtual void SetItemText(const int iIndex,LPCTSTR lpszItemName);
|
||||
|
||||
// Input: iIndex - Index of the item to begin editing for.
|
||||
// Summary: Call this member function to begin local editing of the specified item
|
||||
// in the currently selected folder.
|
||||
virtual void StartItemEdit(const int iIndex);
|
||||
|
||||
// Input: iIndex - Index of the folder to set the text label for.
|
||||
// lpszFolderName - Points to a NULL terminated string.
|
||||
// Summary: Call this member function to set the text label for the specified folder.
|
||||
virtual void SetFolderText(const int iIndex,LPCTSTR lpszFolderName);
|
||||
|
||||
// Input: iIndex - Index of the folder to begin editing.
|
||||
// Summary: Call this member function to begin editing of the specified folder
|
||||
// item's label.
|
||||
virtual void StartGroupEdit(const int iIndex);
|
||||
|
||||
// Input: iIndex - Index of the folder to retrieve the image list for.
|
||||
// bSmall - TRUE to return the small image list. FALSE to return the large image
|
||||
// list.
|
||||
// Returns: A CImageList pointer representing the image list for the folder specified
|
||||
// by 'iIndex'.
|
||||
// Summary: Call this member function to get a pointer to the image list for the
|
||||
// specified folder.
|
||||
virtual CImageList* GetFolderImageList(const int iIndex,const BOOL bSmall) const;
|
||||
|
||||
// Input: dwImageList - If OBS_XT_SMALLICON, the small image list is returned, if OBS_XT_LARGEICON,
|
||||
// the large image list is returned.
|
||||
// Returns: A CImageList pointer representing the global image list for the OutlookBar
|
||||
// control.
|
||||
// Summary: Call this member function to return the global image list for the OutlookBar
|
||||
// control.
|
||||
virtual CImageList* GetImageList(DWORD dwImageList);
|
||||
|
||||
// Input: iFolder - Index of the folder to set the image list for.
|
||||
// pImageList - Points to the new image list.
|
||||
// dwImageList - If OBS_XT_SMALLICON, the small image list is set, if OBS_XT_LARGEICON,
|
||||
// the large image list is set.
|
||||
// Returns: A pointer to the previously set image list, or NULL if no previous
|
||||
// image list exists.
|
||||
// Summary: Call this member function to set the image list for the specified folder.
|
||||
virtual CImageList* SetFolderImageList(const int iFolder,CImageList* pImageList,DWORD dwImageList);
|
||||
|
||||
// Input: pImageList - Points to the new image list.
|
||||
// dwImageList - If OBS_XT_SMALLICON, the small image list is set, if OBS_XT_LARGEICON,
|
||||
// the large image list is set.
|
||||
// Returns: A pointer to the previously set image list, or NULL if no previous image
|
||||
// list exists.
|
||||
// Summary: This member function will set the main image list. You can link different
|
||||
// imagelists to the folders using the SetFolderImageList function. If a
|
||||
// folder has been linked to an image list with the SetFolderImageList function,
|
||||
// it will own the linked image list. Otherwise, it will use the image list
|
||||
// set with this function.
|
||||
virtual CImageList* SetImageList(CImageList* pImageList,DWORD dwImageList);
|
||||
|
||||
// Input: iIndex - Index of the folder to remove.
|
||||
// Summary: Call this member function to remove the specified folder and its items.
|
||||
virtual void RemoveFolder(const int iIndex);
|
||||
|
||||
// Returns: An integer value representing the index of the currently selected folder.
|
||||
// Summary: This member function will get the index of the currently selected folder.
|
||||
virtual int GetSelFolder() const;
|
||||
|
||||
// Returns: An integer value representing the number of folders in the Outlook bar.
|
||||
// Summary: This member function will get the total number of folders found in
|
||||
// the Outlook bar.
|
||||
virtual int GetFolderCount() const;
|
||||
|
||||
// Input: iIndex - Index of the new selected folder.
|
||||
// Summary: This member function will set the selected folder for the Outlook bar.
|
||||
virtual void SetSelFolder(const int iIndex);
|
||||
|
||||
// Returns: An integer value representing the number of items in the current folder.
|
||||
// Summary: This member function gets the number of items found in the currently
|
||||
// selected folder.
|
||||
virtual int GetItemCount() const;
|
||||
|
||||
// Input: iFolder - Index of the folder to insert the item into.
|
||||
// iIndex - Index or position of the item to insert into the folder.
|
||||
// lpszItemName - A NULL terminated string that represents the item label. This value
|
||||
// <b>cannot</b> be set to NULL.
|
||||
// iImage - Index into the folder's image list.
|
||||
// dwData - User defined item data that you can assign to the item. Use GetItemData
|
||||
// and SetItemData to access and change this data.
|
||||
// Returns: The index of the newly inserted item.
|
||||
// Summary: Call this member function to insert an item into the specified folder.
|
||||
virtual int InsertItem(const int iFolder,const int iIndex,LPCTSTR lpszItemName,const int iImage = -1,const DWORD dwData = 0);
|
||||
|
||||
// Input: lpszFolderName - A NULL terminated string that represents the folder's label.
|
||||
// dwData - User defined item data for the folder.
|
||||
// Returns: The index of the newly inserted folder.
|
||||
// Summary: Call this member function to add a folder to the Outlook bar control.
|
||||
virtual int AddFolder(LPCTSTR lpszFolderName,const DWORD dwData);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwRemove - Specifies OBS_XT_ styles to be removed during style modification.
|
||||
// dwAdd - Specifies OBS_XT_ styles to be added during style modification.
|
||||
// bRedraw - true to redraw the Outlook bar.
|
||||
// Summary: Call this member function to modify an Outlook bar style. Styles
|
||||
// to be added or removed can be combined by using the bitwise OR (|)
|
||||
// operator.
|
||||
//
|
||||
// The desired styles for the Outlook bar can be one or more of the
|
||||
// following:
|
||||
// [ul]
|
||||
// [li]<b>OBS_XT_EDITGROUPS</b> Enables folder local editing (renaming).[/li]
|
||||
// [li]<b>OBS_XT_EDITITEMS</b> Enables item local editing (renaming).[/li]
|
||||
// [li]<b>OBS_XT_REMOVEGROUPS</b> Enables the "Remove" command for
|
||||
// folders in context menu.[/li]
|
||||
// [li]<b>OBS_XT_REMOVEITEMS</b> Enables the "Remove" command for
|
||||
// items in context menu.[/li]
|
||||
// [li]<b>OBS_XT_ADDGROUPS</b> Enables folder insertion.[/li]
|
||||
// [li]<b>OBS_XT_DRAGITEMS</b> Enables item dragging to rearrange
|
||||
// position.[/li]
|
||||
// [li]<b>OBS_XT_ANIMATION</b> Enables animation while changing folder
|
||||
// selection.[/li]
|
||||
// [li]<b>OBS_XT_SELHIGHLIGHT</b> Enables dimmed highlight of last
|
||||
// pressed item.[/li]
|
||||
// [li]<b>OBS_XT_DEFAULT</b> Same as OBS_XT_DRAGITEMS | OBS_XT_EDITGROUPS
|
||||
// | OBS_XT_EDITITEMS | OBS_XT_REMOVEGROUPS | OBS_XT_REMOVEITEMS
|
||||
// | OBS_XT_ADDGROUPS.[/li]
|
||||
// [/ul]
|
||||
virtual void ModifyFlag(const DWORD& dwRemove,const DWORD& dwAdd,const bool bRedraw = false);
|
||||
|
||||
// Returns: A DWORD value representing the current style of the Outlook bar.
|
||||
// Summary: Call this member function to get the current style set for the Outlook bar.
|
||||
virtual DWORD GetFlag() const;
|
||||
|
||||
// Input: bSet - TRUE to display small icons, or FALSE to display large icons.
|
||||
// iFolder - Index of the folder to set the icon size for. If -1, all folder icons
|
||||
// are set.
|
||||
// Summary: Call this member function to set the size of the icons displayed in the
|
||||
// Outlook bar control for the specified folder.
|
||||
virtual void SetSmallIconView(const BOOL bSet,const int iFolder=-1);
|
||||
|
||||
// Input: iFolder - Index of the folder to check. If -1, the currently selected folder
|
||||
// is checked.
|
||||
// Returns: TRUE if small icons are displayed, and FALSE if large icons are displayed.
|
||||
// Summary: Call this member function to return the current state of the icon display
|
||||
// for the Outlook bar control.
|
||||
virtual BOOL IsSmallIconView(const int iFolder=-1) const;
|
||||
|
||||
// Input: dwStyle - Style for the Outlook bar. It usually includes the
|
||||
// WS_CHILD|WS_VISIBLE flags.
|
||||
// rect - Size of the Outlook bar.
|
||||
// pParentWnd - Parent of the control.
|
||||
// nID - Identifier of the Outlook bar control.
|
||||
// dwFlag - Specifies the style flags for the control. See ModifyFlag for a list
|
||||
// of available styles.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to create the Outlook bar control.
|
||||
virtual BOOL Create(DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID,const DWORD dwFlag = OBS_XT_DEFAULT);
|
||||
|
||||
// Input: dwExStyle - Extended style for the Outlook bar such as WS_EX_STATICEDGE. It can
|
||||
// be NULL.
|
||||
// dwStyle - Style for the Outlook bar. It usually includes the WS_CHILD|WS_VISIBLE
|
||||
// flags.
|
||||
// rect - Size of the Outlook bar.
|
||||
// pParentWnd - Parent of the control.
|
||||
// nID - Identifier of the Outlook bar control.
|
||||
// dwFlag - Specifies the style flags for the control. See ModifyFlag for a list
|
||||
// of available styles.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to create the Outlook bar control.
|
||||
virtual BOOL CreateEx(DWORD dwExStyle,DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID,const DWORD dwFlag = OBS_XT_DEFAULT);
|
||||
|
||||
// Input: pFont - Points to the font to be used by the Outlook bar.
|
||||
// Summary: Call this member function to set the font used by the Outlook bar control.
|
||||
virtual void SetFontX(CFont* pFont);
|
||||
|
||||
// Returns: A pointer to a CFont object representing the font used by the Outlook bar
|
||||
// control.
|
||||
// Summary: Call this member function to retrieve the font used by the Outlook
|
||||
// bar control.
|
||||
virtual CFont* GetFontX();
|
||||
|
||||
// Input: iFolder - Index of the folder to retrieve.
|
||||
// Returns: A pointer to a CXTBarFolder object.
|
||||
// Summary: Call this member function to return a pointer to the CXTBarFolder data
|
||||
// that is associated with the specified folder.
|
||||
virtual CXTBarFolder* GetBarFolder(const int iFolder);
|
||||
|
||||
// Input: iFolder - Index of the folder to retrieve.
|
||||
// iIndex - Index of the item to retrieve.
|
||||
// Returns: A pointer to a CXTBarItem object.
|
||||
// Summary: Call this member function to return a pointer to the CXTBarItem data
|
||||
// that is associated with the specified folder and item.
|
||||
virtual CXTBarItem* GetBarFolderItem(const int iFolder,const int iIndex);
|
||||
|
||||
// Input: clrBack - An RGB value that represents the background color.
|
||||
// Summary: Call this member function to set the background color for the Outlook
|
||||
// bar control.
|
||||
virtual void SetBackColor(COLORREF clrBack);
|
||||
|
||||
// Input: clrText - An RGB value that represents the text item color.
|
||||
// Summary: Call this member function to set the text color for items in the Outlook
|
||||
// bar control.
|
||||
virtual void SetTextColor(COLORREF clrText);
|
||||
|
||||
// Input: iFolder - Index of the folder where the item is located.
|
||||
// iIndex - Index of the item.
|
||||
// rect - Address of a CRect object that will receive the label size.
|
||||
// Summary: Call this member function to retrieve the size of the label for the
|
||||
// specified item.
|
||||
virtual void GetLabelRect(const int iFolder,const int iIndex,CRect& rect);
|
||||
|
||||
// Input: iFolder - Index of the folder where the item is located.
|
||||
// iIndex - Index of the item.
|
||||
// rect - Address of a CRect object that will receive the icon size.
|
||||
// Summary: Call this member function to retrieve the size of the icon for the
|
||||
// specified item.
|
||||
virtual void GetIconRect(const int iFolder,const int iIndex,CRect& rect);
|
||||
|
||||
// Input: rect - Address of a CRect object that will receive the size.
|
||||
// Summary: Call this member function to retrieve the size of the client area for
|
||||
// the Outlook bar. This is the inside area that contains the folders.
|
||||
virtual void GetInsideRect(CRect& rect) const;
|
||||
|
||||
// Input: iFolder - Index of the folder where the item is located.
|
||||
// iIndex - Index of the item.
|
||||
// rect - Address of a CRect object that will receive the item size.
|
||||
// Summary: Call this member function to retrieve the size of the specified item.
|
||||
// The size includes the area occupied by the item's label and icon.
|
||||
virtual void GetItemRect(const int iFolder,const int iIndex,CRect& rect);
|
||||
|
||||
// Input: iIndex - Index of the folder item.
|
||||
// rect - Address of a CRect object that will receive the folder size.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to retrieve the size of the specified folder.
|
||||
virtual BOOL GetFolderRect(const int iIndex,CRect& rect) const;
|
||||
|
||||
// Returns: An integer value representing the index of the selected item.
|
||||
// Summary: This member function will return the index of the currently selected
|
||||
// item for the currently selected folder.
|
||||
inline int GetCurSel();
|
||||
|
||||
// Input: iItem - Index of the item to select.
|
||||
// bPressed - true if the item is to be pressed when selected.
|
||||
// Summary: This member function will set the currently selected item for the currently
|
||||
// selected folder.
|
||||
inline void SetCurSel(int iItem,const BOOL bPressed=false);
|
||||
|
||||
// Input: iFolder - Index of the folder that owns the item.
|
||||
// iItem - Index of the item to enable or disable.
|
||||
// bEnable - true to enable item, false to disable.
|
||||
// Summary: Call this member function to enable or disable a folder item.
|
||||
void EnableItem(int iFolder,int iItem,bool bEnable);
|
||||
|
||||
protected:
|
||||
|
||||
virtual void DrawScrollButton(CDC* pDC, CRect rect, UINT uType, UINT uState);
|
||||
virtual void DrawItem(CDC* pDC, const int iFolder, CRect rc, const int iIndex, const BOOL bOnlyImage = false);
|
||||
virtual void DrawDragArrow(CDC* pDC, const int iFrom, const int iTo);
|
||||
virtual void DrawAnimItem(const int iOffsetX, const int iOffsetY, const int iIndex);
|
||||
virtual void DrawFolder(CDC* pDC, const int iIndex, CRect rect, const FOLDER_HILIGHT eHilight);
|
||||
virtual void DrawIcon(CDC* pDC, int iIcon, int iFolder, bool bHilight);
|
||||
virtual void PaintItems(CDC* pDC, const int iFolder, CRect rc);
|
||||
virtual void GetVisibleRange(const int iFolder, int& iFirst, int& iLast);
|
||||
virtual int GetDragItemRect(const int iIndex, CRect& rect);
|
||||
virtual CSize GetItemSize(const int iFolder, const int iIndex, const int iType);
|
||||
virtual void AnimateFolderScroll(const int iFrom, const int iTo);
|
||||
virtual void HighlightItem(const int iIndex, const BOOL bPressed = false);
|
||||
virtual void HighlightFolder(const int iIndex);
|
||||
virtual int HitTestEx(const CPoint& point, int& iIndex);
|
||||
virtual BOOL IsValidItem(const int iIndex) const;
|
||||
virtual void EndLabelEdit(CXTEditItem* pEdit, bool bIsFolder);
|
||||
virtual void OnLabelChanged (const XT_OUTBAR_INFO* pObi);
|
||||
virtual void DrawItemIcon( CDC* pDC, CPoint pt, CXTIconHandle hIcon, BOOL bEnabled );
|
||||
virtual void DrawItemText( CDC* pDC, CRect rc, CString strText, UINT nFormat, BOOL bEnabled );
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTOutBarCtrl)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTOutBarCtrl)
|
||||
afx_msg void OnTimer(UINT_PTR nIDEvent);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg void OnLargeIcon();
|
||||
afx_msg void OnUpdateLargeIcon(CCmdUI* pCmdUI);
|
||||
afx_msg void OnSmallIcon();
|
||||
afx_msg void OnUpdateSmallIcon(CCmdUI* pCmdUI);
|
||||
afx_msg void OnRemoveItem();
|
||||
afx_msg void OnUpdateRemoveItem(CCmdUI* pCmdUI);
|
||||
afx_msg void OnRenameItem();
|
||||
afx_msg void OnUpdateRenameItem(CCmdUI* pCmdUI);
|
||||
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnDestroy();
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
friend class CXTEditItem;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE int CXTOutBarCtrl::GetCurSel() {
|
||||
return m_nItemHilighted;
|
||||
}
|
||||
AFX_INLINE void CXTOutBarCtrl::SetCurSel(int iItem, const BOOL bPressed/*=false*/) {
|
||||
HighlightItem(iItem, bPressed);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTBarItem is a stand alone helper class. It is used by the CXTOutBarCtrl
|
||||
// to maintain information about each folder item specified in the Outlook
|
||||
// bar control.
|
||||
class _XT_EXT_CLASS CXTBarItem
|
||||
{
|
||||
public:
|
||||
|
||||
// Input: lpszName - A NULL terminated string that represents the item name.
|
||||
// nImageIndex - An index into the folders image list.
|
||||
// dwData - User item data (lParam).
|
||||
// Summary: Constructs a CXTBarItem object.
|
||||
CXTBarItem(LPCTSTR lpszName,const int nImageIndex,DWORD dwData);
|
||||
|
||||
// Summary: Destroys a CXTBarItem object, handles cleanup and de-allocation.
|
||||
virtual ~CXTBarItem();
|
||||
|
||||
// Returns: An integer value that represents the zero-based index of the folder item.
|
||||
// Summary: Call this member function to retrieve the zero-based index of the folder
|
||||
// item.
|
||||
int GetIndex();
|
||||
|
||||
// Input: iIndex - New index of the folder item.
|
||||
// Summary: Call this member function to set the zero-based index of the folder item.
|
||||
void SetIndex(int iIndex);
|
||||
|
||||
// Returns: A DWORD value that represents the user data.
|
||||
// Summary: Call this member function to return the user specified item data (lParam)
|
||||
// for the folder item.
|
||||
DWORD GetData();
|
||||
|
||||
// Input: dwData - Specifies the user data (lparam) value to be associated with the
|
||||
// folder item.
|
||||
// Summary: Call this member function to set a user data (lParam) value for the
|
||||
// folder item.
|
||||
void SetData(DWORD dwData);
|
||||
|
||||
// Returns: A CString object that contains the folder item label.
|
||||
// Summary: Call this member function to retrieve the label of the folder item.
|
||||
CString GetName();
|
||||
|
||||
// Input: strName - A NULL terminated string that represents the item label.
|
||||
// Summary: Call this member function to set the label of the folder item.
|
||||
void SetName(CString strName);
|
||||
|
||||
// Input: bSelected - true to set the item state to selected.
|
||||
// Summary: Call this member function to set the items selected state.
|
||||
void SelectItem(bool bSelected);
|
||||
|
||||
// Returns: true if the item is selected, otherwise returns false.
|
||||
// Summary: Call this member function to see if the item is selected.
|
||||
bool IsSelected();
|
||||
|
||||
// Input: bEnable - true to enable, false to disable.
|
||||
// Summary: Call this member function to toggle the enabled state for the outlook
|
||||
// bar item.
|
||||
void EnableItem(bool bEnable);
|
||||
|
||||
// Returns: true if the item is enabled, otherwise returns false.
|
||||
// Summary: Call this member function to determine if the item is enabled.
|
||||
bool IsEnabled();
|
||||
|
||||
protected:
|
||||
|
||||
int m_nIndex;
|
||||
bool m_bEnabled; // true if the icon is enabled.
|
||||
bool m_bSelected;
|
||||
DWORD m_dwData;
|
||||
CString m_strName;
|
||||
|
||||
friend class CXTOutBarCtrl;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTBarItem::SelectItem(bool bSelected) {
|
||||
m_bSelected = bSelected;
|
||||
}
|
||||
AFX_INLINE bool CXTBarItem::IsSelected() {
|
||||
return m_bSelected;
|
||||
}
|
||||
AFX_INLINE void CXTBarItem::EnableItem(bool bEnable) {
|
||||
m_bEnabled = bEnable;
|
||||
}
|
||||
AFX_INLINE bool CXTBarItem::IsEnabled() {
|
||||
return m_bEnabled;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTBarFolder is a stand alone helper class. It is used by the CXTOutBarCtrl
|
||||
// to maintain information about each folder specified in the Outlook bar
|
||||
// control.
|
||||
class _XT_EXT_CLASS CXTBarFolder
|
||||
{
|
||||
public:
|
||||
|
||||
// Input: lpszName - A NULL terminated string that represents the item name.
|
||||
// dwData - User item data (lParam).
|
||||
// Summary: Constructs a CXTBarFolder object.
|
||||
CXTBarFolder(LPCTSTR lpszName,DWORD dwData);
|
||||
|
||||
// Summary: Destroys a CXTBarFolder object, handles cleanup and de-allocation.
|
||||
virtual ~CXTBarFolder();
|
||||
|
||||
// Returns: The number of folders in the Outlook bar.
|
||||
// Summary: Call this member function to get the number of folders found in the
|
||||
// Outlook bar.
|
||||
int GetItemCount();
|
||||
|
||||
// Input: iIndex - Index of the item.
|
||||
// lpszName - A NULL terminated string that represents the label of the item.
|
||||
// nImage - Index into the folder's image list.
|
||||
// dwData - User item data (lParam).
|
||||
// Returns: An integer value.
|
||||
// Summary: Call this member function to insert an item into the Outlook bar folder.
|
||||
int InsertItem(int iIndex,LPCTSTR lpszName,const int nImage,const DWORD dwData);
|
||||
|
||||
// Input: iIndex - Index of the item to retrieve.
|
||||
// Returns: A pointer to a CXTBarItem object.
|
||||
// Summary: Call this member function to retrieve the specified item.
|
||||
CXTBarItem* GetItemAt(int iIndex);
|
||||
|
||||
// Input: iIndex - Zero-based index of where to insert the new item.
|
||||
// pBarItem - Points to a valid CXTBarItem object.
|
||||
// Summary: Call this member function to insert a folder item into the location
|
||||
// specified by 'iIndex'.
|
||||
void InsertItemAt(int iIndex,CXTBarItem* pBarItem);
|
||||
|
||||
// Input: iIndex - Index of the item to remove.
|
||||
// Returns: A pointer to the removed item.
|
||||
// Summary: Call this member function to remove the specified item from the folder.
|
||||
CXTBarItem* RemoveItemAt(int iIndex);
|
||||
|
||||
// Returns: A CString object.
|
||||
// Summary: Call this member function to return the label of the folder item.
|
||||
CString GetName();
|
||||
|
||||
// Input: strName - A NULL terminated string that represents the folder's new label.
|
||||
// Summary: Call this member function to set the label for the folder item.
|
||||
void SetName(CString strName);
|
||||
|
||||
// Returns: A DWORD value that represents the item data.
|
||||
// Summary: Call this member function to return the user item data (lParam) for
|
||||
// the folder.
|
||||
DWORD GetData();
|
||||
|
||||
// Input: dwData - User item data (lParam).
|
||||
// Summary: Call this member function to set the user item data (lParam) for the
|
||||
// folder.
|
||||
void SetData(DWORD dwData);
|
||||
|
||||
// Returns: A pointer to CImageList object if successful, otherwise returns NULL.
|
||||
// Summary: Call this member function to return a pointer to the large image list
|
||||
// for the folder.
|
||||
CImageList* GetLargeImageList();
|
||||
|
||||
// Input: pLargeList - Points to a CImageList object.
|
||||
// Summary: Call this member function to set the large image list for the folder.
|
||||
void SetLargeImageList(CImageList* pLargeList);
|
||||
|
||||
// Returns: A CImageList object if successful, otherwise returns NULL.
|
||||
// Summary: Call this member function to return a pointer to the small image list
|
||||
// for the folder.
|
||||
CImageList* GetSmallImageList();
|
||||
|
||||
// Input: pSmallList - Points to a CImageList object.
|
||||
// Summary: Call this member function to set the small image list for the folder.
|
||||
void SetSmallImageList(CImageList* pSmallList);
|
||||
|
||||
// Returns: A CWnd pointer to the child associated with the folder, or NULL if no
|
||||
// objects were found.
|
||||
// Summary: Call this member function to retrieve a CWnd pointer to the child object
|
||||
// that is associated with this folder item.
|
||||
CWnd* GetChild();
|
||||
|
||||
// Input: pChild - Points to a valid CWnd object.
|
||||
// Summary: Call this member function to set the CWnd child to be associated with this
|
||||
// folder item.
|
||||
void SetChild(CWnd* pChild);
|
||||
|
||||
// Input: iItem - Index of the item to select
|
||||
// Summary: Call this member function to set the currently selected item for the folder.
|
||||
void SetSelItem(int iItem);
|
||||
|
||||
// Returns: A pointer to a CXTBarItem object if successful, otherwise returns NULL.
|
||||
// Summary: Call this member function to return a pointer to the currently selected
|
||||
// item.
|
||||
CXTBarItem* GetSelItem();
|
||||
|
||||
// Returns: The index of the currently selected item if successful, otherwise returns -1.
|
||||
// Summary: Call this member function to return the index for the currently selected
|
||||
// item.
|
||||
int GetSelIndex();
|
||||
|
||||
protected:
|
||||
|
||||
BOOL m_bSmallIcons;
|
||||
CWnd* m_pChild;
|
||||
DWORD m_dwData;
|
||||
CString m_strName;
|
||||
CImageList* m_pLargeList;
|
||||
CImageList* m_pSmallList;
|
||||
CList<CXTBarItem*, CXTBarItem*> m_barItems;
|
||||
|
||||
friend class CXTOutBarCtrl;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTOutBarCtrl::SetFontX(CFont* pFont) {
|
||||
ASSERT_VALID(pFont); LOGFONT lf; pFont->GetLogFont(&lf); m_font.DeleteObject(); m_font.CreateFontIndirect(&lf);
|
||||
}
|
||||
AFX_INLINE CFont* CXTOutBarCtrl::GetFontX() {
|
||||
return &m_font;
|
||||
}
|
||||
AFX_INLINE void CXTOutBarCtrl::SetAnimationTickCount(const long lValue) {
|
||||
m_nAnimationTickCount = lValue;
|
||||
}
|
||||
AFX_INLINE int CXTOutBarCtrl::GetAnimationTickCount() {
|
||||
return m_nAnimationTickCount;
|
||||
}
|
||||
AFX_INLINE CXTBarFolder* CXTOutBarCtrl::GetBarFolder(const int iFolder) {
|
||||
return (CXTBarFolder*)m_arFolder.GetAt(iFolder);
|
||||
}
|
||||
AFX_INLINE CXTBarItem* CXTOutBarCtrl::GetBarFolderItem(const int iFolder, const int iIndex) {
|
||||
return GetBarFolder(iFolder)->GetItemAt(iIndex);
|
||||
}
|
||||
AFX_INLINE void CXTOutBarCtrl::SetBackColor(COLORREF clrBack) {
|
||||
m_bUserClrBack = TRUE;
|
||||
m_clrBack = clrBack;
|
||||
}
|
||||
AFX_INLINE void CXTOutBarCtrl::SetTextColor(COLORREF clrText) {
|
||||
m_bUserClrText = TRUE;
|
||||
m_clrText = clrText;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE int CXTBarItem::GetIndex() {
|
||||
return m_nIndex;
|
||||
}
|
||||
AFX_INLINE void CXTBarItem::SetIndex(int iIndex) {
|
||||
m_nIndex = iIndex;
|
||||
}
|
||||
AFX_INLINE DWORD CXTBarItem::GetData() {
|
||||
return m_dwData;
|
||||
}
|
||||
AFX_INLINE void CXTBarItem::SetData(DWORD dwData) {
|
||||
m_dwData = dwData;
|
||||
}
|
||||
AFX_INLINE CString CXTBarItem::GetName() {
|
||||
return m_strName;
|
||||
}
|
||||
AFX_INLINE void CXTBarItem::SetName(CString strName) {
|
||||
m_strName = strName;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE int CXTBarFolder::GetItemCount() {
|
||||
return (int)m_barItems.GetCount();
|
||||
}
|
||||
AFX_INLINE CString CXTBarFolder::GetName() {
|
||||
return m_strName;
|
||||
}
|
||||
AFX_INLINE void CXTBarFolder::SetName(CString strName) {
|
||||
m_strName = strName;
|
||||
}
|
||||
AFX_INLINE DWORD CXTBarFolder::GetData() {
|
||||
return m_dwData;
|
||||
}
|
||||
AFX_INLINE void CXTBarFolder::SetData(DWORD dwData) {
|
||||
m_dwData = dwData;
|
||||
}
|
||||
AFX_INLINE CImageList* CXTBarFolder::GetLargeImageList() {
|
||||
return m_pLargeList;
|
||||
}
|
||||
AFX_INLINE void CXTBarFolder::SetLargeImageList(CImageList* pLargeList) {
|
||||
m_pLargeList = pLargeList;
|
||||
}
|
||||
AFX_INLINE CImageList* CXTBarFolder::GetSmallImageList() {
|
||||
return m_pSmallList;
|
||||
}
|
||||
AFX_INLINE void CXTBarFolder::SetSmallImageList(CImageList* pSmallList) {
|
||||
m_pSmallList = pSmallList;
|
||||
}
|
||||
AFX_INLINE CWnd* CXTBarFolder::GetChild() {
|
||||
return m_pChild;
|
||||
}
|
||||
AFX_INLINE void CXTBarFolder::SetChild(CWnd* pChild) {
|
||||
m_pChild = pChild;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTEditItem is a helper class derived from CXTEdit. It is used by
|
||||
// CXTOutBarCtrl, an Outlook like control, to create an in-place edit box
|
||||
// that is used to modify a folder or an item within the control.
|
||||
class _XT_EXT_CLASS CXTEditItem : public CXTEdit
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTEditItem)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTEditItem object.
|
||||
CXTEditItem();
|
||||
|
||||
// Summary: Destroys a CXTEditItem object, handles cleanup and de-allocation.
|
||||
virtual ~CXTEditItem();
|
||||
|
||||
protected:
|
||||
|
||||
int m_iIndex; // Index of the folder or item.
|
||||
bool m_bEscapeKey; // true if the escape key was pressed.
|
||||
bool m_bSmallIcons; // true if the folder is using small icons.
|
||||
bool m_bIsFolder; // true if the edit box is for a folder.
|
||||
CRect m_rcOriginal; // Original size of the edit box when it was first created.
|
||||
CString m_strText; // Original string of the edit box when it was first created, and the new text on edit completion.
|
||||
CXTOutBarCtrl* m_pParentWnd; // Parent Outlook bar control.
|
||||
|
||||
public:
|
||||
|
||||
// Returns: An integer value that represents the index of the folder or item.
|
||||
// Summary: Call this member function to return the index of the folder or item
|
||||
// currently being edited.
|
||||
int GetIndex() const;
|
||||
|
||||
// Returns: A CString object that represents the text originally
|
||||
// set for the edit control. If called after the edit is destroyed, it
|
||||
// returns the modified text value.
|
||||
// Summary: Call this member function to return the text associated with this edit
|
||||
// control.
|
||||
CString GetText() const;
|
||||
|
||||
// Input: lpszText - NULL terminated string to be displayed in the edit control.
|
||||
// dwStyle - Window style for the edit control.
|
||||
// rect - Size of the edit control.
|
||||
// pParentWnd - Owner window.
|
||||
// nID - Control ID.
|
||||
// nIndex - Folder or item index.
|
||||
// bIsFolder - true if the edit is for a folder item.
|
||||
// bSmallIcons - true if the parent folder is displaying small icons.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: The Outlook bar control calls this member to create an in-place edit
|
||||
// control.
|
||||
virtual BOOL Create(LPCTSTR lpszText,DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID,UINT nIndex,bool bIsFolder,bool bSmallIcons);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTEditItem)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
protected:
|
||||
virtual void PostNcDestroy();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTEditItem)
|
||||
|
||||
afx_msg void OnKillFocus(CWnd* pNewWnd);
|
||||
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE int CXTEditItem::GetIndex() const {
|
||||
return m_iIndex;
|
||||
}
|
||||
AFX_INLINE CString CXTEditItem::GetText() const {
|
||||
return m_strText;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTToolBox is a CXTOutBarCtrl derived class. It is used to create a
|
||||
// toolbox control similar to the toolbox control seen in VisualStudio.NET.
|
||||
class _XT_EXT_CLASS CXTToolBox : public CXTOutBarCtrl
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTToolBox)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTToolBox object.
|
||||
CXTToolBox();
|
||||
|
||||
// Summary: Destroys a CXTToolBox object, handles cleanup and de-allocation.
|
||||
virtual ~CXTToolBox();
|
||||
|
||||
protected:
|
||||
|
||||
int m_iFirst; // Index of the first visible item.
|
||||
int m_iLast; // Index of the last visible item.
|
||||
bool m_bAnimating; // true if the folder selection is changing.
|
||||
|
||||
public:
|
||||
|
||||
// Input: iItem - Index of the item to select.
|
||||
// iFolder - Index of the folder the item belongs to.
|
||||
// Summary: Call this member function to set the selection for the item specified
|
||||
// by 'iItem'.
|
||||
void SetSelItem(int iItem,int iFolder);
|
||||
|
||||
// Input: dwExStyle - Extended style for the toolbox, such as WS_EX_STATICEDGE. It can be
|
||||
// NULL.
|
||||
// dwStyle - Style for the toolbox. It usually includes the WS_CHILD|WS_VISIBLE
|
||||
// flags.
|
||||
// rect - Size of the toolbox.
|
||||
// pParentWnd - Parent of the control.
|
||||
// nID - Identifier of the toolbox control.
|
||||
// dwFlag - Specifies the style flags for the control. See CXTOutBarCtrl::ModifyFlag
|
||||
// for a list of available styles.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to create the toolbox control.
|
||||
virtual BOOL CreateEx(DWORD dwExStyle,DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID,const DWORD dwFlag = OBS_XT_DEFAULT);
|
||||
|
||||
// Input: iFolder - Index of the folder where the item is located.
|
||||
// iIndex - Index of the item.
|
||||
// rect - Address of a CRect object that will receive the icon size.
|
||||
// Summary: Call this member function to retrieve the size of the icon for the
|
||||
// specified item.
|
||||
virtual void GetIconRect(const int iFolder,const int iIndex,CRect& rect);
|
||||
|
||||
// Input: iFolder - Index of the folder where the item is located.
|
||||
// iIndex - Index of the item.
|
||||
// rect - Address of a CRect object that will receive the item size.
|
||||
// Summary: Call this member function to retrieve the size of the specified item.
|
||||
// The size includes the area occupied by the item's label and icon.
|
||||
virtual void GetItemRect(const int iFolder,const int iIndex,CRect& rect);
|
||||
|
||||
// Input: iIndex - Index of the new selected folder.
|
||||
// Summary: This member function will set the selected folder for the toolbox.
|
||||
virtual void SetSelFolder(const int iIndex);
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTToolBox)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual void DrawIcon(CDC* pDC, int iIcon, int iFolder, bool bHilight);
|
||||
virtual void DrawItem(CDC* pDC, const int iFolder, CRect rc, const int iIndex, const BOOL bOnlyImage);
|
||||
virtual void DrawFolder(CDC* pDC, const int iIndex, CRect rect, const FOLDER_HILIGHT eHilight);
|
||||
virtual void DrawScrollButton(CDC* pDC, CRect rect, UINT uType, UINT uState);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTToolBox)
|
||||
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTOUTBARCTRL_H__)
|
||||
161
Editor/XT/Include/XTOutlookBar.h
Normal file
161
Editor/XT/Include/XTOutlookBar.h
Normal file
@@ -0,0 +1,161 @@
|
||||
// XTOutlookBar.h interface for the CXTContentItems class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTOUTLOOKBAR_H__)
|
||||
#define __XTOUTLOOKBAR_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_CONTENT_ITEM is a stand alone helper structure class. It is used
|
||||
// by CXTOutlookBar.
|
||||
struct XT_CONTENT_ITEM
|
||||
{
|
||||
int m_nIndex; // Zero-based index for the menu item.
|
||||
CString m_strText; // Text label for the menu item.
|
||||
CXTIconHandle m_hIcon; // Icon handle for the menu item.
|
||||
};
|
||||
|
||||
// Summary: CList definition for XT_CONTENT_ITEM structure list.
|
||||
typedef CList<XT_CONTENT_ITEM*,XT_CONTENT_ITEM*> CXTContentItemList;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CCXTOutlookBar is a CListBox derived class. It is used to implement
|
||||
// an Outlook bar style control. It can only be used with the LBS_OWNERDRAWVARIABLE
|
||||
// style bit set. This is a simpler version of CXTOutBarCtrl and does not
|
||||
// allow for shortcut folders.
|
||||
class _XT_EXT_CLASS CXTOutlookBar : public CListBox
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTOutlookBar)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTOutlookBar object.
|
||||
CXTOutlookBar();
|
||||
|
||||
// Summary: Destroys a CXTOutlookBar object, handles cleanup and de-allocation.
|
||||
virtual ~CXTOutlookBar();
|
||||
|
||||
protected:
|
||||
|
||||
int m_cxIcon; // Width of the menu icon.
|
||||
int m_cyIcon; // Height of the menu icon.
|
||||
int m_nIndex; // Currently selected menu index.
|
||||
bool m_bHilight; // true when the menu item is selected.
|
||||
bool m_bUserColors; // true when the user has defined custom colors for the Outlook bar.
|
||||
CPoint m_point; // Holds the cursor position.
|
||||
COLORREF m_clrBack; // RGB value representing the background color.
|
||||
COLORREF m_clrText; // RGB value representing the text color.
|
||||
CXTContentItemList m_arContentItems; // Array of XT_CONTENT_ITEM structs that represent each item in the Outlook bar.
|
||||
|
||||
public:
|
||||
|
||||
// Input: dwStyle - Window style.
|
||||
// rect - The size and position of the window, in client coordinates of
|
||||
// 'pParentWnd'.
|
||||
// pParentWnd - The parent window.
|
||||
// nID - The ID of the child window.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function creates an Outlook Bar control.
|
||||
virtual BOOL Create(DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID);
|
||||
|
||||
// Input: clrText - RGB value representing the text color.
|
||||
// clrBack - RGB value representing the background color.
|
||||
// Summary: Call this member function to set the text and background colors for
|
||||
// the Outlook bar.
|
||||
void SetColors(COLORREF clrText,COLORREF clrBack);
|
||||
|
||||
// Returns: An RGB value that represents the background color.
|
||||
// Summary: This member function gets an RGB value that represents the control's
|
||||
// background color.
|
||||
COLORREF GetBackColor();
|
||||
|
||||
// Returns: An RGB value that represents the text color.
|
||||
// Summary: This member function gets an RGB value that represents the control's
|
||||
// text color.
|
||||
COLORREF GetTextColor();
|
||||
|
||||
// Input: iIndex - Specifies the zero-based index of the position to insert the
|
||||
// menu item. If this parameter is -1, the menu item is added to the
|
||||
// end of the list.
|
||||
// nIconID - Resource ID of the icon associated with this menu item.
|
||||
// lpszText - Points to the null-terminated string for the menu item
|
||||
// Returns: The zero-based index of the position at which the menu item was inserted.
|
||||
// The return value is LB_ERR if an error occurs. The return value is LB_ERRSPACE
|
||||
// if insufficient space is available to store the new menu item.
|
||||
// Summary: This member function inserts a menu item into the Outlook bar. Unlike
|
||||
// the AddMenuItem member function, InsertMenuItem does not cause an Outlook
|
||||
// bar with the LBS_SORT style to be sorted.
|
||||
int InsertMenuItem(int iIndex,UINT nIconID,LPCTSTR lpszText);
|
||||
|
||||
// Input: nIconID - Resource ID of the icon associated with this menu item.
|
||||
// lpszText - Points to the null-terminated string for the menu item.
|
||||
// Returns: The zero-based index to the menu item in the Outlook bar. The return
|
||||
// value is LB_ERR if an error occurs. The return value is LB_ERRSPACE
|
||||
// if insufficient space is available to store the new menu item.
|
||||
// Summary: Call this member function to add a menu item to an Outlook bar. If
|
||||
// the Outlook bar was not created with the LBS_SORT style, the menu item
|
||||
// is added to the end of the Outlook bar. Otherwise, the menu item is
|
||||
// inserted into the Outlook bar, and the Outlook bar is sorted. If the
|
||||
// Outlook bar was created with the LBS_SORT style but not the LBS_HASSTRINGS
|
||||
// style, the framework sorts the Outlook bar by one or more calls to
|
||||
// the CompareItem member function. Use InsertMenuItem to insert a menu
|
||||
// item into a specific location within the Outlook bar.
|
||||
int AddMenuItem(UINT nIconID,LPCTSTR lpszText);
|
||||
|
||||
// Input: iItem - Specifies the zero-based index of the menu item to retrieve.
|
||||
// Returns: An XT_CONTENT_ITEM pointer.
|
||||
// Summary: Call this member function to return an XT_CONTENT_ITEM object that
|
||||
// represents the menu item specified by 'iItem'.
|
||||
XT_CONTENT_ITEM* GetMenuItem(int iItem);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTOutlookBar)
|
||||
public:
|
||||
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
|
||||
virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Input: pDC - Points to the current device context.
|
||||
// Summary: This member function is called by the control for flicker free drawing.
|
||||
void OnNoFlickerPaint(CDC* pDC);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTOutlookBar)
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnTimer(UINT_PTR nIDEvent);
|
||||
afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnPaint();
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTOutlookBar::SetColors(COLORREF clrText, COLORREF clrBack) {
|
||||
m_clrBack = clrBack; m_clrText = clrText; m_bUserColors = true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTOUTLOOKBAR_H__)
|
||||
208
Editor/XT/Include/XTPagerCtrl.h
Normal file
208
Editor/XT/Include/XTPagerCtrl.h
Normal file
@@ -0,0 +1,208 @@
|
||||
// XTPagerCtrl.h interface for the CXTPagerCtrl class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTPAGERCTRL_H__)
|
||||
#define __XTPAGERCTRL_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTPagerCtrl is a CWnd derived class. It is used to contain and scroll
|
||||
// another window, and wraps the windows pager API.
|
||||
class _XT_EXT_CLASS CXTPagerCtrl : public CWnd
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTPagerCtrl)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTPagerCtrl object.
|
||||
CXTPagerCtrl();
|
||||
|
||||
// Summary: Destroys a CXTPagerCtrl object, handles cleanup and de-allocation.
|
||||
virtual ~CXTPagerCtrl();
|
||||
|
||||
protected:
|
||||
|
||||
public:
|
||||
|
||||
// Input: dwStyle - Specifies the window style attributes. The following styles are
|
||||
// also used when creating pager controls, and can be combined by using
|
||||
// the or (|) operator:
|
||||
// [ul]
|
||||
// [li]<b>PGS_AUTOSCROLL</b> The pager control will scroll when the
|
||||
// user hovers the mouse over one of the scroll buttons.[/li]
|
||||
// [li]<b>PGS_DRAGNDROP</b> The contained window can be a drag-and-drop
|
||||
// target. The pager control will automatically scroll if an item
|
||||
// is dragged from outside the pager over one of the scroll buttons.[/li]
|
||||
// [li]<b>PGS_HORZ</b> Creates a pager control that can be scrolled
|
||||
// horizontally. This style and the PGS_VERT style are mutually
|
||||
// exclusive and cannot be combined.[/li]
|
||||
// [li]<b>PGS_VERT</b> Creates a pager control that can be scrolled
|
||||
// vertically. This is the default direction no direction style
|
||||
// is specified. This style and the PGS_HORZ style are mutually
|
||||
// exclusive and cannot be combined.[/li]
|
||||
// [/ul]
|
||||
// rect - The size and position of the window, in client coordinates of
|
||||
// 'pParentWnd'.
|
||||
// pParentWnd - The parent window.
|
||||
// nID - The ID of the child window.
|
||||
// Summary: This member function creates a pager child window and attaches it to
|
||||
// this CWnd object. Returns nonzero if successful, otherwise returns zero.
|
||||
virtual BOOL Create(DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID);
|
||||
|
||||
// Input: hwndChild - Handle to the window to be contained.
|
||||
// Summary: This member function sets the contained window for the pager control.
|
||||
// This command will not change the parent of the contained window. It
|
||||
// only assigns a window handle to the pager control for scrolling. In
|
||||
// most cases, the contained window will be a child window. If this is
|
||||
// the case, the contained window should be a child of the pager control.
|
||||
void SetChild(HWND hwndChild);
|
||||
|
||||
// Summary: This member function forces the pager control to recalculate the
|
||||
// size of the contained window. Using this command will result in a
|
||||
// PGN_CALCSIZE notification being sent.
|
||||
void RecalcSize();
|
||||
|
||||
// Input: bForward - BOOL value that determines if mouse forwarding is enabled or
|
||||
// disabled. If this value is nonzero, mouse forwarding is enabled.
|
||||
// If this value is zero, mouse forwarding is disabled.
|
||||
// Summary: This member function enables or disables mouse forwarding for the
|
||||
// pager control. When mouse forwarding is enabled, the pager control
|
||||
// forwards WM_MOUSEMOVE messages to the contained window.
|
||||
void ForwardMouse(BOOL bForward);
|
||||
|
||||
// Input: clr - COLORREF value that contains the new background color of the
|
||||
// pager control.
|
||||
// Returns: A COLORREF value that contains the previous background color.
|
||||
// Summary: This member function sets the current background color for the pager
|
||||
// control.
|
||||
COLORREF SetBkColor(COLORREF clr);
|
||||
|
||||
// Returns: A COLORREF value that contains the current background color.
|
||||
// Summary: This member function retrieves the current background color for
|
||||
// the pager control.
|
||||
COLORREF GetBkColor();
|
||||
|
||||
// Input: iBorder - New size of the border, in pixels. This value should not be
|
||||
// larger than the pager button or less than zero. If 'iBorder'
|
||||
// is too large, the border will be drawn the same size as the
|
||||
// button. If 'iBorder' is negative, the border size will be set
|
||||
// to zero.
|
||||
// Returns: An integer value that contains the previous border size, in pixels.
|
||||
// Summary: This member function sets the current border size for the pager
|
||||
// control.
|
||||
int SetBorder(int iBorder);
|
||||
|
||||
// Returns: An integer value that contains the current border size, in pixels.
|
||||
// Summary: This member function retrieves the current border size for the pager
|
||||
// control.
|
||||
int GetBorder();
|
||||
|
||||
// Input: iPos - Integer value that contains the new scroll position, in pixels.
|
||||
// Summary: This member function sets the scroll position for the pager control.
|
||||
void SetPos(int iPos);
|
||||
|
||||
// Returns: An integer value that contains the current scroll position, in pixels.
|
||||
// Summary: This member function retrieves the current scroll position of the
|
||||
// pager control.
|
||||
int GetPos();
|
||||
|
||||
// Input: iSize - Integer value that contains the new button size, in pixels.
|
||||
// Returns: An integer value that contains the previous button size, in pixels.
|
||||
// Summary: This member function sets the current button size for the pager
|
||||
// control.
|
||||
int SetButtonSize(int iSize);
|
||||
|
||||
// Returns: An integer value that contains the current button size, in pixels.
|
||||
// Summary: This member function retrieves the current button size for the pager
|
||||
// control.
|
||||
int GetButtonSize();
|
||||
|
||||
// Input: iButton - Indicates which button to retrieve the state for. See the description
|
||||
// for 'iButton' in PGM_GETBUTTONSTATE for a list of possible values.
|
||||
// Returns: The state of the button specified in 'iButton'. See the return value
|
||||
// description in PGM_GETBUTTONSTATE for a list of possible values.
|
||||
// Summary: This member function retrieves the state of the specified button
|
||||
// in a pager control.
|
||||
DWORD GetButtonState(int iButton);
|
||||
|
||||
// Input: ppdt - Address of an IDropTarget pointer that receives the interface
|
||||
// pointer. It is the caller's responsibility to call Release on this
|
||||
// pointer when it is no longer needed.
|
||||
// Summary: This member function retrieves a pager control's IDropTarget interface
|
||||
// pointer.
|
||||
void GetDropTarget(IDropTarget **ppdt);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTPagerCtrl)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTPagerCtrl)
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTPagerCtrl::SetChild(HWND hwndChild) {
|
||||
ASSERT(::IsWindow(m_hWnd)); Pager_SetChild(m_hWnd, hwndChild);
|
||||
}
|
||||
AFX_INLINE void CXTPagerCtrl::RecalcSize() {
|
||||
ASSERT(::IsWindow(m_hWnd)); Pager_RecalcSize(m_hWnd);
|
||||
}
|
||||
AFX_INLINE void CXTPagerCtrl::ForwardMouse(BOOL bForward) {
|
||||
ASSERT(::IsWindow(m_hWnd)); Pager_ForwardMouse(m_hWnd, bForward);
|
||||
}
|
||||
AFX_INLINE COLORREF CXTPagerCtrl::SetBkColor(COLORREF clr) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return Pager_SetBkColor(m_hWnd, clr);
|
||||
}
|
||||
AFX_INLINE COLORREF CXTPagerCtrl::GetBkColor() {
|
||||
ASSERT(::IsWindow(m_hWnd)); return Pager_GetBkColor(m_hWnd);
|
||||
}
|
||||
AFX_INLINE int CXTPagerCtrl::SetBorder(int iBorder) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return Pager_SetBorder(m_hWnd, iBorder);
|
||||
}
|
||||
AFX_INLINE int CXTPagerCtrl::GetBorder() {
|
||||
ASSERT(::IsWindow(m_hWnd)); return Pager_GetBorder(m_hWnd);
|
||||
}
|
||||
AFX_INLINE void CXTPagerCtrl::SetPos(int iPos) {
|
||||
ASSERT(::IsWindow(m_hWnd)); Pager_SetPos(m_hWnd, iPos);
|
||||
}
|
||||
AFX_INLINE int CXTPagerCtrl::GetPos() {
|
||||
ASSERT(::IsWindow(m_hWnd)); return Pager_GetPos(m_hWnd);
|
||||
}
|
||||
AFX_INLINE int CXTPagerCtrl::SetButtonSize(int iSize) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return Pager_SetButtonSize(m_hWnd, iSize);
|
||||
}
|
||||
AFX_INLINE int CXTPagerCtrl::GetButtonSize() {
|
||||
ASSERT(::IsWindow(m_hWnd)); return Pager_GetButtonSize(m_hWnd);
|
||||
}
|
||||
AFX_INLINE DWORD CXTPagerCtrl::GetButtonState(int iButton) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return Pager_GetButtonState(m_hWnd, iButton);
|
||||
}
|
||||
AFX_INLINE void CXTPagerCtrl::GetDropTarget(IDropTarget **ppdt) {
|
||||
ASSERT(::IsWindow(m_hWnd)); Pager_GetDropTarget(m_hWnd, ppdt);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTPAGERCTRL_H__)
|
||||
163
Editor/XT/Include/XTPopupTearOffWnd.h
Normal file
163
Editor/XT/Include/XTPopupTearOffWnd.h
Normal file
@@ -0,0 +1,163 @@
|
||||
// XTPopupTearOffWnd.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTPOPUPTEAROFFWND_H__)
|
||||
#define __XTPOPUPTEAROFFWND_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
class CXTToolBar;
|
||||
class CXTWndHook;
|
||||
class CXTToolbarTearOff;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTPopupTearOffWnd is a CWnd derived class window . It is used to display a
|
||||
// "tear-off" popup window to be activated when the user presses the down arrow on
|
||||
// a toolbar
|
||||
class _XT_EXT_CLASS CXTPopupTearOffWnd : public CWnd
|
||||
{
|
||||
public:
|
||||
|
||||
// Input: iCmdID - Command ID that is currently active for the popup window.
|
||||
// Summary: Constructs a CXTPopupTearOffWnd object.
|
||||
CXTPopupTearOffWnd(int iCmdID);
|
||||
|
||||
// Summary: Destroys a CXTPopupTearOffWnd object, handles cleanup and de-allocation.
|
||||
virtual ~CXTPopupTearOffWnd();
|
||||
|
||||
// Attributes
|
||||
protected:
|
||||
|
||||
int m_iCmdID; // Command ID of the button that created this window.
|
||||
BOOL m_bTearOff; // If window is tear-off
|
||||
CWnd* m_pChild; // Child window
|
||||
CRect m_rcExclude; // Exclusion rectangle for drawing adjacent borders.
|
||||
CXTToolBar* m_pWndParent; // Pointer to the parent toolbar.
|
||||
CXTWndHook* m_pHook; // Message hook.
|
||||
|
||||
private:
|
||||
|
||||
BOOL m_bPressed;
|
||||
BOOL m_bHighlighted;
|
||||
CXTControlBar* m_pControlBar;
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Input: pParent - Points to a valid parent toolbar.
|
||||
// pControlBar - Points to a valid child controlbar.
|
||||
// Summary: Call this member function to create a CXTToolBarPopupWnd object.
|
||||
virtual BOOL Create(CXTToolBar* pParent,CXTControlBar* pControlBar);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTPopupTearOffWnd)
|
||||
protected:
|
||||
virtual void PostNcDestroy();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
BOOL PtInTearOffRect(CPoint point);
|
||||
virtual void OnHookedCommand(WPARAM wParam, LPARAM lParam);
|
||||
virtual void OnStartDrag(CPoint point);
|
||||
BOOL _Create(CXTToolBar* pParent, CWnd* pChild, CXTControlBar* pControlBar);
|
||||
virtual CWnd* CloneChild(CXTControlBar* pControlBar) = 0;
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTPopupTearOffWnd)
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
|
||||
afx_msg void OnNcPaint();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) ;
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg void OnCaptureChanged(CWnd *pWnd);
|
||||
//}}AFX_MSG
|
||||
|
||||
class CXTPopupTearOffWndWndHook;
|
||||
friend class CXTPopupTearOffWndWndHook;
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTPopupColorTearOff is a CXTPopupTearOffWnd derived class window . It is used to display a
|
||||
// "tear-off" popup window with Color Selector as a child
|
||||
class _XT_EXT_CLASS CXTPopupColorTearOff : public CXTPopupTearOffWnd
|
||||
{
|
||||
public:
|
||||
|
||||
// Input: iCmdID - Command ID that is currently active for the popup window.
|
||||
// Summary: Constructs a CXTPopupToolbarTearOff object.
|
||||
CXTPopupColorTearOff(int iCmdID);
|
||||
|
||||
protected:
|
||||
|
||||
CWnd* CloneChild(CXTControlBar* pControlBar);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTPopupColorTearOff)
|
||||
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
|
||||
afx_msg LRESULT OnSelEndOK(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTPopupToolbarTearOff is a CXTPopupTearOffWnd derived class window . It is used to
|
||||
// display a "tear-off" popup window with Toolbar as a child
|
||||
class _XT_EXT_CLASS CXTPopupToolbarTearOff : public CXTPopupTearOffWnd
|
||||
{
|
||||
public:
|
||||
|
||||
// Input: iCmdID - Command ID that is currently active for the popup window.
|
||||
// Summary: Constructs a CXTPopupToolbarTearOff object.
|
||||
CXTPopupToolbarTearOff(int& iCmdID);
|
||||
|
||||
// Input: pParent - Points to a valid parent toolbar.
|
||||
// pControlBar - Points to a valid child toolbar.
|
||||
// iNumCols - Number of columns to display when the toolbar is displayed.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to create a CXTPopupToolbarTearOff object.
|
||||
virtual BOOL Create(CXTToolBar* pParent,CXTToolBar* pControlBar,int iNumCols=5);
|
||||
|
||||
private:
|
||||
int& m_iCmd;
|
||||
void OnHookedCommand(WPARAM wParam, LPARAM lParam);
|
||||
CWnd* CloneChild(CXTControlBar* pControlBar);
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTPopupToolbarTearOff)
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif //__XTPOPUPTEAROFFWND_H__
|
||||
76
Editor/XT/Include/XTPreviewView.h
Normal file
76
Editor/XT/Include/XTPreviewView.h
Normal file
@@ -0,0 +1,76 @@
|
||||
// XTPreviewView.h interface for the CXTPreviewView class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTPREVIEWVIEW_H__)
|
||||
#define __XTPREVIEWVIEW_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTPreviewView is a CPreviewView derived class. CXTPreviewView is used
|
||||
// to create an office style print preview window. To use the CXTPreviewView
|
||||
// class add the following code to your CView derived class:
|
||||
//
|
||||
// <pre>void CPrintPreviewView::OnFilePrintPreview()
|
||||
// {
|
||||
// // show print preview.
|
||||
// _xtAfxShowPrintPreview( this );
|
||||
// }</pre>
|
||||
class _XT_EXT_CLASS CXTPreviewView : public CPreviewView
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTPreviewView)
|
||||
|
||||
protected:
|
||||
|
||||
// Summary: Constructs a CXTPreviewView object.
|
||||
CXTPreviewView();
|
||||
|
||||
// Summary: Destroys a CXTPreviewView object, handles cleanup and de-allocation.
|
||||
virtual ~CXTPreviewView();
|
||||
|
||||
public:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTPreviewView)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Summary: This member function is called by the print preview view
|
||||
// to update the toolbar button icon to represent the current
|
||||
// view display state, either 1 or 2 pages.
|
||||
virtual void UpdateNumPageIcon();
|
||||
|
||||
protected:
|
||||
|
||||
int m_i1PageIndex; // Icon index of the single page toolbar button
|
||||
int m_i2PageIndex; // Icon index of the dual page toolbar button
|
||||
CXTToolBar m_wndToolBar; // Toolbar used by print preview.
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTPreviewView)
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
|
||||
afx_msg void OnUpdateNumPageChange(CCmdUI* pCmdUI);
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTPREVIEWVIEW_H__)
|
||||
224
Editor/XT/Include/XTReBar.h
Normal file
224
Editor/XT/Include/XTReBar.h
Normal file
@@ -0,0 +1,224 @@
|
||||
// XTReBar.h interface for the CXTReBar class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTREBAR_H__)
|
||||
#define __XTREBAR_H__
|
||||
|
||||
// import base class
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
// class forwards
|
||||
|
||||
class CXTReBarCtrl;
|
||||
class CXTNewCustomBarRequest;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTReBar is a CXTControlBar derived class. It is used to create a CXTReBar
|
||||
// object. A CXTReBar object is a control bar that provides layout, persistence,
|
||||
// and state information for rebar controls.
|
||||
//
|
||||
// A rebar object can contain a variety of child windows, usually other
|
||||
// controls, including edit boxes, toolbars, and list boxes. A rebar object
|
||||
// can display its child windows over a specified bitmap. Your application
|
||||
// can automatically resize the rebar, or the user can manually resize
|
||||
// the rebar by clicking or dragging its gripper bar.
|
||||
//
|
||||
// <b>Rebar Control</b>
|
||||
//
|
||||
// A rebar object behaves similarly to a toolbar object. A rebar uses
|
||||
// the click-and-drag mechanism to resize its bands. A rebar control can
|
||||
// contain one or more bands, with each band having any combination of
|
||||
// a gripper bar, a bitmap, a text label, and a child window. However,
|
||||
// bands cannot contain more than one child window.
|
||||
//
|
||||
// CXTReBar uses the CXTReBarCtrl class to provide its implementation.
|
||||
// You can access the rebar control through GetReBarCtrl to take advantage
|
||||
// of the control's customization options. For more information about
|
||||
// rebar controls, see CXTReBarCtrl. For more information about using
|
||||
// rebar controls, see Using CXTReBarCtrl in the XTreme Toolkit online
|
||||
// help.
|
||||
//
|
||||
// <b>Warning</b> Rebar and rebar control objects do not support MFC
|
||||
// control bar docking. If CRebar::EnableDocking is called, your application
|
||||
// will assert.
|
||||
class _XT_EXT_CLASS CXTReBar : public CXTControlBar
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTReBar)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTReBar object.
|
||||
CXTReBar();
|
||||
|
||||
// Input: pParentWnd - Pointer to the CWnd object whose Windows window is the parent of the
|
||||
// status bar. This is normally your frame window.
|
||||
// dwCtrlStyle - The rebar control style. By default, RBS_BANDBORDERS, which displays
|
||||
// narrow lines to separate adjacent bands within the rebar control.
|
||||
// See Rebar Control Styles in the Platform SDK for a list of styles.
|
||||
// dwStyle - The rebar window styles.
|
||||
// nID - The rebar's child-window ID.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to create a rebar.
|
||||
BOOL Create(CWnd* pParentWnd,DWORD dwCtrlStyle = RBS_BANDBORDERS,DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_TOP,UINT nID = AFX_IDW_REBAR);
|
||||
|
||||
// Returns: A reference to a CXTReBarCtrl object.
|
||||
// Example: <pre>CXTReBarCtrl& refReBarCtrl = m_wndReBar.GetReBarCtrl();</pre>
|
||||
//
|
||||
// <pre>
|
||||
// UINT nBandCount = refReBarCtrl.GetBandCount();
|
||||
// CString msg;
|
||||
// msg.Format("Band Count is: %u", nBandCount);
|
||||
// AfxMessageBox(msg);</pre>
|
||||
// Summary: This member function allows direct access to the underlying common
|
||||
// control. Call this member function to take advantage of the functionality
|
||||
// of the Windows rebar common control in customizing your rebar. When
|
||||
// you call GetReBarCtrl, it returns a reference object to the CXTReBarCtrl
|
||||
// object so you can use either set of member functions.
|
||||
//
|
||||
// For more information about using CXTReBarCtrl to customize your rebar,
|
||||
// see Using CXTReBarCtrl in the XTreme Toolkit online help.
|
||||
CXTReBarCtrl& GetReBarCtrl() const;
|
||||
|
||||
// Input: pBar - A pointer to a CWnd object that is the child window to be inserted
|
||||
// into the rebar. The referenced object must have a WS_CHILD.
|
||||
// pszText - A pointer to a string containing the text to appear on the rebar.
|
||||
// NULL by default. The text contained in 'pszText' is not part of the
|
||||
// child window. It is on the rebar itself.
|
||||
// pbmp - A pointer to a CBitmap object to be displayed on the rebar background.
|
||||
// NULL by default.
|
||||
// dwStyle - A DWORD containing the style to apply to the rebar. See the 'fStyle'
|
||||
// function description in the Win32 structure REBARBANDINFO for a complete
|
||||
// list of band styles.
|
||||
// Example: <pre>
|
||||
// // Define a pointer to a CRebar in your class definition,
|
||||
// // such as: CReBar* m_pReBar; More often, however, you
|
||||
// // would probably specify an instance in your class
|
||||
// // definition, such as: CReBar m_ReBar;
|
||||
// m_pReBar = new CReBar();
|
||||
// m_pReBar->Create(this);
|
||||
// m_wndDlgBar.Create(this, IDR_MAINFRAME, CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR);
|
||||
// m_pReBar->AddBar(&m_wndDlgBar);</pre>
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to add a band to the rebar.
|
||||
BOOL AddBar(CWnd* pBar,LPCTSTR pszText = NULL,CBitmap* pbmp = NULL,DWORD dwStyle = RBBS_GRIPPERALWAYS | RBBS_FIXEDBMP);
|
||||
|
||||
// Input: pBar - A pointer to a CWnd object that is the child window to be inserted
|
||||
// into the rebar. The referenced object must have a WS_CHILD.
|
||||
// clrFore - An RGB value that represents the foreground color of the rebar.
|
||||
// clrBack - An RGB value that represents the background color of the rebar.
|
||||
// pszText - A pointer to a string containing the text to appear on the rebar.
|
||||
// NULL by default. The text contained in 'pszText' is not part of the
|
||||
// child window. It is on the rebar itself.
|
||||
// dwStyle - A DWORD containing the style to apply to the rebar. See the 'fStyle'
|
||||
// function description in the Win32 structure REBARBANDINFO for a complete
|
||||
// list of band styles.
|
||||
// Example: <pre>
|
||||
// // Define a pointer to a CRebar in your class definition,
|
||||
// // such as: CReBar* m_pReBar; More often, however, you
|
||||
// // would probably specify an instance in your class
|
||||
// // definition, such as: CReBar m_ReBar;
|
||||
// m_pReBar = new CReBar();
|
||||
// m_pReBar->Create(this);
|
||||
// m_wndDlgBar.Create(this, IDR_MAINFRAME, CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR);
|
||||
// m_pReBar->AddBar(&m_wndDlgBar);</pre>
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to add a band to the rebar.
|
||||
BOOL AddBar(CWnd* pBar,COLORREF clrFore,COLORREF clrBack,LPCTSTR pszText = NULL,DWORD dwStyle = RBBS_GRIPPERALWAYS);
|
||||
|
||||
// Input: pBar - A pointer to a CWnd object that is the child window to be inserted
|
||||
// into the rebar. The referenced object must have a WS_CHILD.
|
||||
// pRBBI - Points to a REBARBANDINFO struct that contains information about
|
||||
// the band added to a rebar control.
|
||||
// Example: <pre>
|
||||
// // Define a pointer to a CRebar in your class definition,
|
||||
// // such as: CReBar* m_pReBar; More often, however, you
|
||||
// // would probably specify an instance in your class
|
||||
// // definition, such as: CReBar m_ReBar;
|
||||
// m_pReBar = new CReBar();
|
||||
// m_pReBar->Create(this);
|
||||
// m_wndDlgBar.Create(this, IDR_MAINFRAME, CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR);
|
||||
// m_pReBar->AddBar(&m_wndDlgBar);</pre>
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to add a band to the rebar.
|
||||
BOOL AddBar(CWnd* pBar,REBARBANDINFO* pRBBI);
|
||||
|
||||
// Input: lpszSection - Name of a section in the initialization file or a key in the Windows
|
||||
// registry where state information is stored.
|
||||
// Summary: Call this function to store information about the rebar owned by the
|
||||
// frame window. This information can be read from the initialization
|
||||
// file using LoadState. Information stored includes visibility,
|
||||
// horizontal and vertical orientation, band size, and control bar position.
|
||||
void SaveState(LPCTSTR lpszSection);
|
||||
|
||||
// Input: lpszSection - Name of a section in the initialization file or a key in the Windows
|
||||
// registry where state information is stored.
|
||||
// Summary: Call this function to restore the settings of the rebar owned by the
|
||||
// frame window. This information is written to the initialization file
|
||||
// using SaveState. Information restored includes visibility,
|
||||
// horizontal and vertical orientation, band size, and control bar position.
|
||||
void LoadState(LPCTSTR lpszSection);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTReBar)
|
||||
public:
|
||||
virtual void OnUpdateCmdUI(CFrameWnd* pTarget,BOOL bDisableIfNoHndler);
|
||||
virtual INT_PTR OnToolHitTest(CPoint point,TOOLINFO* pTI) const;
|
||||
virtual CSize CalcFixedLayout(BOOL bStretch,BOOL bHorz);
|
||||
virtual CSize CalcDynamicLayout(int nLength,DWORD nMode);
|
||||
protected:
|
||||
virtual LRESULT WindowProc(UINT message,WPARAM wParam,LPARAM lParam);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
int m_iBandCount;
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTReBar)
|
||||
afx_msg BOOL OnNcCreate(LPCREATESTRUCT);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnHeightChange(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnNcPaint();
|
||||
afx_msg void OnNcCalcSize(BOOL, NCCALCSIZE_PARAMS*);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg LRESULT OnShowBand(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg void OnRecalcParent();
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg void OnChildSize(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg LRESULT OnIdealSizeChanged(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
void OnBarDestroyed(CControlBar* pBar);
|
||||
void SaveCustomBars(LPCTSTR pszSection);
|
||||
void LoadCustomBars(LPCTSTR pszSection);
|
||||
void CreateBar(CXTNewCustomBarRequest* pRequest);
|
||||
public:
|
||||
void PlaceNewBar(CFrameWnd* pFrame, CControlBar* pBar);
|
||||
protected:
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE CXTReBarCtrl& CXTReBar::GetReBarCtrl() const {
|
||||
return *(CXTReBarCtrl*)this;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTREBAR_H__)
|
||||
573
Editor/XT/Include/XTReBarCtrl.h
Normal file
573
Editor/XT/Include/XTReBarCtrl.h
Normal file
@@ -0,0 +1,573 @@
|
||||
// XTReBarCtrl.h interface for the CXTReBarCtrl class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTREBARCTRL_H__)
|
||||
#define __XTREBARCTRL_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTReBarCtrl is a CWnd derived class. The CXTReBarCtrl class encapsulates
|
||||
// the functionality of a rebar control, which is a container for a child
|
||||
// window. The application in which the rebar control resides assigns
|
||||
// the child window contained by the rebar control to the rebar band.
|
||||
// The child window is usually another common control.
|
||||
//
|
||||
// Rebar controls contain one or more bands. Each band can contain a combination
|
||||
// of a gripper bar, a bitmap, a text label, and a child window. The band
|
||||
// can contain only one of each of these items.
|
||||
//
|
||||
// The rebar control can display the child window over a specified background
|
||||
// bitmap. All rebar control bands can be resized, except those that use
|
||||
// the RBBS_FIXEDSIZE style. As you reposition or resize a rebar control
|
||||
// band, the rebar control manages the size and position of the child window
|
||||
// assigned to that band. To resize or change the order of bands within
|
||||
// the control, click and drag a band's gripper bar. A rebar control has
|
||||
// three bands:
|
||||
// [ul]
|
||||
// [li]A flat, transparent toolbar control.[/li]
|
||||
// [li]Both transparent standard and transparent dropdown buttons.[/li]
|
||||
// [li]A combo box and four standard buttons.[/li]
|
||||
// [/ul]
|
||||
// <b>Rebar control</b>
|
||||
//
|
||||
// Rebar controls support:
|
||||
// [ul]
|
||||
// [li]Image lists.[/li]
|
||||
// [li]Message-handling.[/li]
|
||||
// [li]Custom draw functionality.[/li]
|
||||
// [li]A variety of control styles in addition to standard window styles. For
|
||||
// a list of these styles, see Rebar Control Styles in the Platform SDK.[/li]
|
||||
// [/ul]
|
||||
// See Also: CXTReBarCtrl
|
||||
class _XT_EXT_CLASS CXTReBarCtrl : public CWnd
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTReBarCtrl)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTReBarCtrl object.
|
||||
CXTReBarCtrl();
|
||||
|
||||
// NUMBERED LIST:
|
||||
|
||||
// Input: dwStyle - Specifies the combination of rebar control styles applied to the control.
|
||||
// See Rebar Control Styles in the Platform SDK for a list of supported
|
||||
// styles.
|
||||
// rect - A reference to a CRect object or RECT structure, which is the position
|
||||
// and size of the rebar control.
|
||||
// pParentWnd - A pointer to a CWnd object that is the parent window of the rebar
|
||||
// control. It must not be NULL.
|
||||
// nID - Specifies the rebar control's control ID.
|
||||
// Example: <pre>
|
||||
// CXTReBarCtrl* pReBarCtrl = new CXTReBarCtrl();
|
||||
// CRect rect;
|
||||
// GetWindowRect(rect);
|
||||
// pReBarCtrl->Create(RBS_BANDBORDERS, rect, this, AFX_IDW_REBAR);</pre>
|
||||
//
|
||||
// Use ReBar Control.
|
||||
// ...
|
||||
// <pre>delete pReBarCtrl;</pre>
|
||||
// Returns: Nonzero if the object was created successfully, otherwise returns zero.
|
||||
// Summary: Call this member function to create a rebar control. Create a rebar
|
||||
// control in two steps:
|
||||
// [ol]
|
||||
// [li]Call CXTReBarCtrl to construct a CXTReBarCtrl object.[/li]
|
||||
// [li]Call this member function, which creates the Windows rebar control
|
||||
// and attaches it to the CXTReBarCtrl object.[/li]
|
||||
// [/ol]
|
||||
// When you call Create, the common controls are initialized.
|
||||
BOOL Create(DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID);
|
||||
|
||||
// Returns: The number of bands assigned to the control.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_GETBANDCOUNT, as described in the Platform SDK.
|
||||
UINT GetBandCount() const;
|
||||
|
||||
// Input: uBand - Zero-based index of the band for which the information will be retrieved.
|
||||
// prbbi - A pointer to a REBARBANDINFO structure to receive the band information.
|
||||
// You must set the 'cbSize' member of this structure to sizeof(REBARBANDINFO)
|
||||
// and set the 'fMask' member to the items you want to retrieve before
|
||||
// sending this message.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_GETBANDINFO as described in the Platform SDK.
|
||||
BOOL GetBandInfo(UINT uBand,REBARBANDINFO* prbbi) const;
|
||||
|
||||
// Returns: A value that represents the height, in pixels, of the control.
|
||||
// Summary: Call this member function to retrieve the height of the rebar bar.
|
||||
UINT GetBarHeight() const;
|
||||
|
||||
// Input: prbi - A pointer to a REBARINFO structure that will receive the rebar control
|
||||
// information. You must set the 'cbSize' member of this structure to
|
||||
// sizeof(REBARINFO) before sending this message.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_GETBARINFO, as described in the Platform SDK.
|
||||
BOOL GetBarInfo(REBARINFO* prbi) const;
|
||||
|
||||
// Returns: A COLORREF value that represent the current default background color.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_GETBKCOLOR, as described in the Platform SDK.
|
||||
COLORREF GetBkColor() const;
|
||||
|
||||
// Returns: A pointer to an IDropTarget interface.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_GETDROPTARGET, as described in the Platform SDK.
|
||||
IDropTarget* GetDropTarget() const;
|
||||
|
||||
// Input: uBand - Zero-based index of a band in the rebar control.
|
||||
// prc - A pointer to a RECT structure that will receive the bounds of the
|
||||
// rebar band.
|
||||
// Example: <pre>
|
||||
// CRect rc;
|
||||
// m_wndReBar.GetReBarCtrl().GetRect(0, &rc);
|
||||
//
|
||||
// CString msg;
|
||||
// msg.Format("rect.left = %d, rect.top = %d, rect.right = %d, rect.bottom = %d",
|
||||
// rc.left, rc.top, rc.right, rc.bottom);
|
||||
//
|
||||
// AfxMessageBox(msg);</pre>
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_GETRECT, as described in the Platform SDK.
|
||||
BOOL GetRect(UINT uBand,LPRECT prc) const;
|
||||
|
||||
// Example: <pre>
|
||||
// UINT nRowCount = m_wndReBar.GetReBarCtrl().GetRowCount();
|
||||
//
|
||||
// CString msg;
|
||||
// msg.Format("Row Count is %d", nRowCount);
|
||||
//
|
||||
// AfxMessageBox(msg);</pre>
|
||||
// Returns: A UINT value that represents the number of band rows in the control.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_GETROWCOUNT, as described in the Platform SDK.
|
||||
UINT GetRowCount() const;
|
||||
|
||||
// Input: uRow - Zero-based index of the band that will have its height retrieved.
|
||||
// Example: <pre>int nCount = m_wndReBar.GetReBarCtrl().GetRowCount();
|
||||
// int i;
|
||||
// for (i=0; i < nCount; i++)
|
||||
// {
|
||||
// UINT nHeight = m_wndReBar.GetReBarCtrl().GetRowHeight(i);
|
||||
// CString msg;
|
||||
// msg.Format("Height of row %d is %u", i, nHeight);
|
||||
// AfxMessageBox(msg);
|
||||
// }</pre>
|
||||
// Returns: A UINT value that represents the row height, in pixels.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_GETROWHEIGHT, as described in the Platform SDK.
|
||||
UINT GetRowHeight(UINT uRow) const;
|
||||
|
||||
// Returns: A COLORREF value that represents the current default text color.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_GETTEXTCOLOR, as described in the Platform SDK.
|
||||
COLORREF GetTextColor() const;
|
||||
|
||||
// Returns: A pointer to a CToolTipCtrl object.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_GETTOOLTIPS, as described in the Platform SDK. Note that the MFC
|
||||
// implementation of GetToolTips returns a pointer to a CToolTipCtrl,
|
||||
// rather than an HWND.
|
||||
CToolTipCtrl* GetToolTips() const;
|
||||
|
||||
// Input: uBandID - The application-defined identifier of the specified band, passed in
|
||||
// the 'wID' member of the REBARBANDINFO structure when the band is inserted.
|
||||
// Returns: The zero-based band index if successful, or -1 otherwise. If duplicate
|
||||
// band indices exist, the first one is returned.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_IDTOINDEX, as described in the Platform SDK.
|
||||
int IDToIndex(UINT uBandID) const;
|
||||
|
||||
// Input: uBand - Zero-based index of the band to receive the new settings.
|
||||
// prbbi - Pointer to a REBARBANDINFO structure that defines the band to be inserted.
|
||||
// You must set the 'cbSize' member of this structure to sizeof(REBARBANDINFO)
|
||||
// before sending this message.
|
||||
// Example: <pre>
|
||||
// int nCount = m_wndReBar.GetReBarCtrl().GetBandCount();
|
||||
// CString strText = "Band #:";
|
||||
//
|
||||
// int i;
|
||||
// for (i=0; i<nCount; i++)
|
||||
// {
|
||||
// LPREBARBANDINFO prbbi = (LPREBARBANDINFO)alloca(sizeof(REBARBANDINFO));
|
||||
// prbbi->cbSize = sizeof(REBARBANDINFO);
|
||||
//
|
||||
// CString strText;
|
||||
// strText.Format("Band #: %d", i);
|
||||
//
|
||||
// LPTSTR lpszText = strText.GetBuffer(strText.GetLength());
|
||||
// prbbi->lpText = lpszText;
|
||||
// prbbi->cch = strlen(lpszText) + 1;
|
||||
// prbbi->fMask = RBBIM_TEXT;
|
||||
//
|
||||
// m_wndReBar.GetReBarCtrl().SetBandInfo(i, prbbi);
|
||||
//
|
||||
// strText.ReleaseBuffer();
|
||||
// }</pre>
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_SETBANDINFO, as described in the Platform SDK.
|
||||
BOOL SetBandInfo(UINT uBand,REBARBANDINFO* prbbi);
|
||||
|
||||
// Input: prbi - A pointer to a REBARINFO structure that contains the information to
|
||||
// be set. You must set the cbSize member of this structure to
|
||||
// sizeof(REBARINFO) before sending this message
|
||||
// Example: <pre>LPREBARINFO prbi = 0;
|
||||
// prbi = (LPREBARINFO)alloca(sizeof(REBARINFO));
|
||||
// if (!prbi)
|
||||
// {
|
||||
// AfxMessageBox("Couldn't allocate memory for REBARINFO structure!");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// prbi->cbSize = sizeof(REBARINFO);
|
||||
// prbi->fMask = 0;
|
||||
// prbi->himl = 0;
|
||||
// m_wndReBar.GetReBarCtrl().SetBarInfo(prbi);</pre>
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_SETBARINFO, as described in the Platform SDK.
|
||||
BOOL SetBarInfo(REBARINFO* prbi);
|
||||
|
||||
// Input: clr - The COLORREF value that represents the new default background color.
|
||||
// Returns: A COLORREF value that represents the previous default background color.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_SETBKCOLOR, as described in the Platform SDK. See this topic for
|
||||
// more information about when to set the background color, and how to
|
||||
// set the default.
|
||||
COLORREF SetBkColor(COLORREF clr);
|
||||
|
||||
// Input: pWnd - A pointer to a CWnd object to set as the owner of the rebar control.
|
||||
// Returns: A pointer to a CWnd object that is the current owner of the
|
||||
// rebar control.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_SETPARENT, as described in the Platform SDK.
|
||||
//
|
||||
// Note that this member function uses pointers to CWnd objects for both
|
||||
// the current and selected owner of the rebar control, rather than handles
|
||||
// to windows.
|
||||
//
|
||||
// <b>Note</b> This member function does not change the actual parent
|
||||
// that was set when the control was created. Rather, it sends notification
|
||||
// messages to the window you specify.
|
||||
CWnd* SetOwner(CWnd* pWnd);
|
||||
|
||||
// Input: clr - A COLORREF value that represents the new text color in the CXTReBarCtrl
|
||||
// object.
|
||||
// Returns: The COLORREF value representing the previous text color associated with
|
||||
// the CXTReBarCtrl object.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_SETTEXTCOLOR, as described in the Platform SDK. It is provided
|
||||
// to support text color flexibility in a rebar control.
|
||||
COLORREF SetTextColor(COLORREF clr);
|
||||
|
||||
// Input: pToolTip - A pointer to a CToolTipCtrl object.
|
||||
// Summary: Call this member function to associate a tooltip control with a rebar
|
||||
// control. You must destroy the CToolTipCtrl object when you are done
|
||||
// with it.
|
||||
void SetToolTips(CToolTipCtrl* pToolTip);
|
||||
|
||||
// Returns: A pointer to a CImageList object. Returns NULL if no image
|
||||
// list is set for the control.
|
||||
// Summary: Call this member function to get the CImageList object associated with
|
||||
// a rebar control. This member function uses size and mask information
|
||||
// stored in the REBARINFO structure, as described in the Platform SDK.
|
||||
CImageList* GetImageList() const;
|
||||
|
||||
// Input: pImageList - A pointer to a CImageList object containing the image list to be assigned
|
||||
// to the rebar control.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to assign an image list to a rebar control.
|
||||
BOOL SetImageList(CImageList* pImageList);
|
||||
|
||||
// Input: uBand - Zero-based index of the band for which the borders will be retrieved.
|
||||
// prc - A pointer to a RECT structure that will receive the band borders.
|
||||
// If the rebar control has the RBS_BANDBORDERS style, each member of
|
||||
// this structure will receive the number of pixels, on the corresponding
|
||||
// side of the band, that constitute the border. If the rebar control
|
||||
// does not have the RBS_BANDBORDERS style, only the left member of this
|
||||
// structure receives valid information. For a description of rebar
|
||||
// control styles, see Rebar Control Styles in the Platform SDK.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_GETBANDBORDERS, as described in the Platform SDK.
|
||||
void GetBandBorders(UINT uBand,LPRECT prc) const;
|
||||
|
||||
// Example: <pre>
|
||||
// CPalette* pPalette = m_wndReBar.GetReBarCtrl().GetPalette();
|
||||
// if (pPalette)
|
||||
// {
|
||||
// int nEntries = pPalette->GetEntryCount();
|
||||
//
|
||||
// CString msg;
|
||||
// msg.Format("Number of palette entries: %d", nEntries);
|
||||
// AfxMessageBox(msg);
|
||||
// }
|
||||
// else
|
||||
// AfxMessageBox("No palette!");</pre>
|
||||
// Returns: A pointer to a CPalette object specifying the rebar control's
|
||||
// current palette.
|
||||
// Summary: Call this member function to retrieve the rebar control's current palette.
|
||||
// Note that this member function uses a CPalette object as its return value,
|
||||
// rather than an HPALETTE.
|
||||
CPalette* GetPalette() const;
|
||||
|
||||
// Input: hPal - An HPALETTE that specifies the new palette that the rebar control
|
||||
// will use.
|
||||
// Returns: A CPalette object.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_SETPALETTE, as described in the Platform SDK. Note that this member
|
||||
// function uses a CPalette object as its return value, rather than an
|
||||
// HPALETTE.
|
||||
CPalette* SetPalette(HPALETTE hPal);
|
||||
|
||||
// Input: lpcs - A pointer to a valid tagCOLORSCHEME structure.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function is used to retrieve the current color scheme for
|
||||
// the rebar control.
|
||||
BOOL GetColorScheme(COLORSCHEME* lpcs);
|
||||
|
||||
// Input: lpcs - A pointer to a valid tagCOLORSCHEME structure.
|
||||
// Summary: This member function is used to set the current color scheme for the
|
||||
// rebar control.
|
||||
void SetColorScheme(const COLORSCHEME* lpcs);
|
||||
|
||||
// Input: uBand - Zero-based index of the band which the drag-and-drop operation will
|
||||
// affect.
|
||||
// dwPos - A DWORD value that contains the starting mouse coordinates. The horizontal
|
||||
// coordinate is contained in the LOWORD and the vertical coordinate
|
||||
// is contained in the HIWORD. If you pass (DWORD)-1, the rebar control
|
||||
// will use the position of the mouse the last time the control's thread
|
||||
// called ::GetMessage or ::PeekMessage.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_BEGINDRAG, as described in the Platform SDK.
|
||||
void BeginDrag(UINT uBand,DWORD dwPos = (DWORD)-1);
|
||||
|
||||
// Input: uBand - Zero-based index of the band to be deleted.
|
||||
// Example: <pre>
|
||||
// UINT nCount = m_wndReBar.GetReBarCtrl().GetBandCount();
|
||||
//
|
||||
// if (nCount > 0)
|
||||
// m_wndReBar.GetReBarCtrl().DeleteBand(nCount - 1);</pre>
|
||||
// Returns: Nonzero if the band was deleted successfully, otherwise returns zero.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_DELETEBAND, as described in the Platform SDK.
|
||||
BOOL DeleteBand(UINT uBand);
|
||||
|
||||
// Input: dwPos - A DWORD value that contains the new mouse coordinates. The horizontal
|
||||
// coordinate is contained in the LOWORD and the vertical coordinate
|
||||
// is contained in the HIWORD. If you pass (DWORD)-1, the rebar control
|
||||
// will use the position of the mouse the last time the control's thread
|
||||
// called ::GetMessage or ::PeekMessage.
|
||||
// Summary: This member function implements the behavior of the Win32 message RB_DRAGMOVE,
|
||||
// as described in the Platform SDK.
|
||||
void DragMove(DWORD dwPos = (DWORD)-1);
|
||||
|
||||
// Summary: This member function implements the behavior of the Win32 message RB_ENDDRAG,
|
||||
// as described in the Platform SDK.
|
||||
void EndDrag();
|
||||
|
||||
// Input: prbht - A pointer to a RBHITTESTINFO structure. Before sending the message,
|
||||
// the 'pt' member of this structure must be initialized, in client coordinates,
|
||||
// to the point that will be tested.
|
||||
// Returns: The zero-based index of the band at the given point, or -1 if no rebar band
|
||||
// was at the point.
|
||||
// Summary: This member function implements the behavior of the Win32 message RB_HITTEST,
|
||||
// as described in the Platform SDK.
|
||||
int HitTest(RBHITTESTINFO* prbht);
|
||||
|
||||
// Input: uIndex - Zero-based index of the location where the band will be inserted.
|
||||
// If you set this parameter to -1, the control will add the new band
|
||||
// at the last location.
|
||||
// prbbi - A pointer to a REBARBANDINFO structure that defines the band to be
|
||||
// inserted. You must set the 'cbSize' member of this structure to
|
||||
// sizeof(REBARBANDINFO) before calling this function.
|
||||
// Example: <pre>
|
||||
// LPREBARBANDINFO prbbi = (LPREBARBANDINFO)alloca(sizeof(REBARBANDINFO));
|
||||
// prbbi->cbSize = sizeof(REBARBANDINFO);
|
||||
//
|
||||
// LPTSTR lpszText = (LPTSTR)alloca(80);
|
||||
// prbbi->lpText = lpszText;
|
||||
// prbbi->cch = 80;
|
||||
//
|
||||
// prbbi->fMask = RBBIM_BACKGROUND | RBBIM_CHILD |
|
||||
// RBBIM_CHILDSIZE | RBBIM_COLORS | RBBIM_HEADERSIZE |
|
||||
// RBBIM_IDEALSIZE | RBBIM_ID | RBBIM_IMAGE |
|
||||
// RBBIM_LPARAM | RBBIM_SIZE | RBBIM_STYLE | RBBIM_TEXT;
|
||||
//
|
||||
// m_wndReBar.GetReBarCtrl().GetBandInfo(1, prbbi);
|
||||
//
|
||||
// m_wndReBar.GetReBarCtrl().InsertBand(2, prbbi);</pre>
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function implements the behavior of the Win32 message RB_INSERTBAND,
|
||||
// as described in the Platform SDK.
|
||||
BOOL InsertBand(UINT uIndex,REBARBANDINFO* prbbi);
|
||||
|
||||
// Input: uBand - Zero-based index of the band to be maximized.
|
||||
// Example: <pre>
|
||||
// UINT nCount = m_pReBarCtrl->GetBandCount();
|
||||
//
|
||||
// UINT i;
|
||||
// for (i=0; i<nCount; i++)
|
||||
// m_pReBarCtrl->MaximizeBand(i);</pre>
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_MAXIMIZEBAND, as described in the Platform SDK.
|
||||
void MaximizeBand(UINT uBand);
|
||||
|
||||
// Input: uBand - Zero-based index of the band to be minimized.
|
||||
// Example: <pre>
|
||||
// UINT nCount = m_pReBarCtrl->GetBandCount();
|
||||
//
|
||||
// UINT i;
|
||||
// for (i=0; i<nCount; i++)
|
||||
// m_pReBarCtrl->MinimizeBand(i);</pre>
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_MINIMIZEBAND, as described in the Platform SDK.
|
||||
void MinimizeBand(UINT uBand);
|
||||
|
||||
// Input: uBand - Zero-based index of a band in the rebar control.
|
||||
// fShow - Indicates if the band should be shown or hidden. If this value is
|
||||
// TRUE, the band will be shown. Otherwise, the band will be hidden.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_SHOWBAND, as described in the Platform SDK.
|
||||
BOOL ShowBand(UINT uBand,BOOL fShow = TRUE);
|
||||
|
||||
// Input: rect - A reference to a CRect object that specifies the rectangle that the
|
||||
// rebar control should be sized to.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_SIZETORECT, as described in the Platform SDK. Note that this member
|
||||
// function uses a CRect object as a parameter, rather than a RECT structure.
|
||||
BOOL SizeToRect(CRect& rect);
|
||||
|
||||
// Input: uFrom - Zero-based index of the band to be moved.
|
||||
// uTo - Zero-based index of the new band position. This parameter value must
|
||||
// never be greater than the number of bands minus one. To obtain the
|
||||
// number of bands, call GetBandCount.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: This member function implements the behavior of the Win32 message
|
||||
// RB_MOVEBAND, as described in the Platform SDK.
|
||||
BOOL MoveBand(UINT uFrom,UINT uTo);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE UINT CXTReBarCtrl::GetBandCount() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, RB_GETBANDCOUNT, 0, 0L);
|
||||
}
|
||||
AFX_INLINE BOOL CXTReBarCtrl::GetBandInfo(UINT uBand, REBARBANDINFO* prbbi) const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_GETBANDINFO, uBand, (LPARAM)prbbi);
|
||||
}
|
||||
AFX_INLINE UINT CXTReBarCtrl::GetBarHeight() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, RB_GETBARHEIGHT, 0, 0L);
|
||||
}
|
||||
AFX_INLINE BOOL CXTReBarCtrl::GetBarInfo(REBARINFO* prbi) const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_GETBARINFO, 0, (LPARAM)prbi);
|
||||
}
|
||||
AFX_INLINE COLORREF CXTReBarCtrl::GetBkColor() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, RB_GETBKCOLOR, 0, 0L);
|
||||
}
|
||||
AFX_INLINE IDropTarget* CXTReBarCtrl::GetDropTarget() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); IDropTarget* pdt; ::SendMessage(m_hWnd, RB_GETDROPTARGET, 0, (LPARAM)&pdt); return pdt;
|
||||
}
|
||||
AFX_INLINE BOOL CXTReBarCtrl::GetRect(UINT uBand, LPRECT prc) const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_GETRECT, uBand, (LPARAM)prc);
|
||||
}
|
||||
AFX_INLINE UINT CXTReBarCtrl::GetRowCount() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, RB_GETROWCOUNT, 0, 0L);
|
||||
}
|
||||
AFX_INLINE UINT CXTReBarCtrl::GetRowHeight(UINT uRow) const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, RB_GETROWHEIGHT, uRow, 0L);
|
||||
}
|
||||
AFX_INLINE COLORREF CXTReBarCtrl::GetTextColor() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, RB_GETTEXTCOLOR, 0, 0L);
|
||||
}
|
||||
AFX_INLINE CToolTipCtrl* CXTReBarCtrl::GetToolTips() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (CToolTipCtrl*)CWnd::FromHandle((HWND)::SendMessage(m_hWnd, RB_GETTOOLTIPS, 0, 0L));
|
||||
}
|
||||
AFX_INLINE int CXTReBarCtrl::IDToIndex(UINT uBandID) const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, RB_IDTOINDEX, uBandID, 0L);
|
||||
}
|
||||
AFX_INLINE BOOL CXTReBarCtrl::SetBandInfo(UINT uBand, REBARBANDINFO* prbbi) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_SETBANDINFO, uBand, (LPARAM)prbbi);
|
||||
}
|
||||
AFX_INLINE BOOL CXTReBarCtrl::SetBarInfo(REBARINFO* prbi) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_SETBARINFO, 0, (LPARAM)prbi);
|
||||
}
|
||||
AFX_INLINE COLORREF CXTReBarCtrl::SetBkColor(COLORREF clr) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, RB_SETBKCOLOR, 0, (LPARAM)clr);
|
||||
}
|
||||
AFX_INLINE CWnd* CXTReBarCtrl::SetOwner(CWnd* pWnd) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle((HWND)::SendMessage(m_hWnd, RB_SETPARENT, (WPARAM)pWnd->m_hWnd, 0L));
|
||||
}
|
||||
AFX_INLINE COLORREF CXTReBarCtrl::SetTextColor(COLORREF clr) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, RB_SETTEXTCOLOR, 0, (LPARAM)clr);
|
||||
}
|
||||
AFX_INLINE void CXTReBarCtrl::SetToolTips(CToolTipCtrl* pToolTip) {
|
||||
ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_SETTOOLTIPS, (WPARAM)pToolTip->m_hWnd, 0L);
|
||||
}
|
||||
AFX_INLINE void CXTReBarCtrl::GetBandBorders(UINT uBand, LPRECT prc) const {
|
||||
ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_GETBANDBORDERS, uBand, (LPARAM)prc);
|
||||
}
|
||||
AFX_INLINE CPalette* CXTReBarCtrl::GetPalette() const {
|
||||
ASSERT(::IsWindow(m_hWnd)); return CPalette::FromHandle((HPALETTE)::SendMessage(m_hWnd, RB_GETPALETTE, 0, 0L));
|
||||
}
|
||||
AFX_INLINE CPalette* CXTReBarCtrl::SetPalette(HPALETTE hPal) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return CPalette::FromHandle((HPALETTE)::SendMessage(m_hWnd, RB_SETPALETTE, 0, (LPARAM)hPal));
|
||||
}
|
||||
AFX_INLINE void CXTReBarCtrl::BeginDrag(UINT uBand, DWORD dwPos) {
|
||||
ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_BEGINDRAG, uBand, dwPos);
|
||||
}
|
||||
AFX_INLINE BOOL CXTReBarCtrl::DeleteBand(UINT uBand) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_DELETEBAND, uBand, 0L);
|
||||
}
|
||||
AFX_INLINE void CXTReBarCtrl::DragMove(DWORD dwPos) {
|
||||
ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_DRAGMOVE, 0, dwPos);
|
||||
}
|
||||
AFX_INLINE void CXTReBarCtrl::EndDrag() {
|
||||
ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_ENDDRAG, 0, 0L);
|
||||
}
|
||||
AFX_INLINE int CXTReBarCtrl::HitTest(RBHITTESTINFO* prbht) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, RB_HITTEST, 0, (LPARAM)prbht);
|
||||
}
|
||||
AFX_INLINE BOOL CXTReBarCtrl::InsertBand(UINT uIndex, REBARBANDINFO* prbbi) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_INSERTBAND, uIndex, (LPARAM)prbbi);
|
||||
}
|
||||
AFX_INLINE void CXTReBarCtrl::MaximizeBand(UINT uBand) {
|
||||
ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_MAXIMIZEBAND, uBand, 0L);
|
||||
}
|
||||
AFX_INLINE void CXTReBarCtrl::MinimizeBand(UINT uBand) {
|
||||
ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_MINIMIZEBAND, uBand, 0L);
|
||||
}
|
||||
AFX_INLINE BOOL CXTReBarCtrl::ShowBand(UINT uBand, BOOL fShow) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_SHOWBAND, uBand, fShow);
|
||||
}
|
||||
AFX_INLINE BOOL CXTReBarCtrl::SizeToRect(CRect& rect) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_SIZETORECT, 0, (LPARAM)&rect);
|
||||
}
|
||||
AFX_INLINE BOOL CXTReBarCtrl::MoveBand(UINT uFrom, UINT uTo) {
|
||||
ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, RB_MOVEBAND, uFrom, uTo);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTREBARCTRL_H__)
|
||||
437
Editor/XT/Include/XTRegistryManager.h
Normal file
437
Editor/XT/Include/XTRegistryManager.h
Normal file
@@ -0,0 +1,437 @@
|
||||
// XTRegistryManager.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __XTREGISTRYMANAGER_H__
|
||||
#define __XTREGISTRYMANAGER_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTRegistryManager is a stand alone registry management class. You
|
||||
// can use it to read and write values from your system's registry or an
|
||||
// .INI file. Use CXTRegistryManager to read and write string, integer,
|
||||
// and binary data to and from the registry. You can also specify an .INI
|
||||
// file name, and have these values stored there instead.
|
||||
class _XT_EXT_CLASS CXTRegistryManager
|
||||
{
|
||||
public:
|
||||
|
||||
// Input: hKeyBase - Current key to be used in the registry.
|
||||
// Summary: Constructs a CXTRegistryManager object.
|
||||
CXTRegistryManager(HKEY hKeyBase = HKEY_CURRENT_USER);
|
||||
|
||||
// Summary: Destroys a CXTRegistryManager object, handles cleanup and de-allocation.
|
||||
virtual ~CXTRegistryManager();
|
||||
|
||||
protected:
|
||||
|
||||
HKEY m_hKeyBase; // Handle to the registry key to use. The default is HKEY_CURRENT_USER.
|
||||
CString m_strINIFileName; // Name of an .INI file for registry settings.
|
||||
CWinApp* m_pWinApp; // Points to an application's CWinApp object.
|
||||
|
||||
public:
|
||||
|
||||
// Input: strINIFileName - Full path to the .INI file.
|
||||
// Summary: This member function will set the .INI file name for the registry
|
||||
// manager to use instead of the system registry.
|
||||
void SetINIFileName(CString strINIFileName);
|
||||
|
||||
// Returns: A CString object.
|
||||
// Summary: This member function will return the file name of the .INI file
|
||||
// used by the registry manager.
|
||||
CString GetINIFileName();
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry. If the section does not exist, it is created.
|
||||
// The name of the section is case independent. The string may be any
|
||||
// combination of uppercase and lowercase letters.
|
||||
// section - Points to a null-terminated string that contains the entry into
|
||||
// which the value is to be written. If the entry does not exist in
|
||||
// the specified section, it is created.
|
||||
// nValue - Contains the value to be written.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to write the specified INT value into
|
||||
// the specified section of the application<6F>s registry or .INI file.
|
||||
BOOL WriteProfileInt(LPCTSTR lpszSection,LPCTSTR lpszEntry,int nValue);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry. If the section does not exist, it is created.
|
||||
// The name of the section is case independent. The string may be any
|
||||
// combination of uppercase and lowercase letters.
|
||||
// lpszEntry - Points to a null-terminated string that contains the entry into
|
||||
// which the value is to be written. If the entry does not exist in
|
||||
// the specified section, it is created.
|
||||
// pData - Contains the value to be written.
|
||||
// nBytes - Contains the size of the value to be written.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to write the specified binary value into
|
||||
// the specified section of the application<6F>s registry or .INI file.
|
||||
BOOL WriteProfileBinary(LPCTSTR lpszSection,LPCTSTR lpszEntry,LPBYTE pData,UINT nBytes);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry. If the section does not exist, it is created.
|
||||
// The name of the section is case independent. The string may be any
|
||||
// combination of uppercase and lowercase letters.
|
||||
// lpszEntry - Points to a null-terminated string that contains the entry into
|
||||
// which the value is to be written. If the entry does not exist in
|
||||
// the specified section, it is created.
|
||||
// lpszValue - Contains the value to be written.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to write the specified string value into
|
||||
// the specified section of the application<6F>s registry or .INI file.
|
||||
BOOL WriteProfileString(LPCTSTR lpszSection,LPCTSTR lpszEntry,LPCTSTR lpszValue);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry. If the section does not exist, it is created.
|
||||
// The name of the section is case independent. The string may be any
|
||||
// combination of uppercase and lowercase letters.
|
||||
// lpszEntry - Points to a null-terminated string that contains the entry into
|
||||
// which the value is to be written. If the entry does not exist in
|
||||
// the specified section, it is created.
|
||||
// pValue - Contains the value to be written.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to write the specified CPoint value into
|
||||
// the specified section of the application<6F>s registry or .INI file.
|
||||
BOOL WriteProfilePoint(LPCTSTR lpszSection,LPCTSTR lpszEntry,CPoint * pValue);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry. If the section does not exist, it is created.
|
||||
// The name of the section is case independent. The string may be any
|
||||
// combination of uppercase and lowercase letters.
|
||||
// lpszEntry - Points to a null-terminated string that contains the entry into
|
||||
// which the value is to be written. If the entry does not exist in
|
||||
// the specified section, it is created.
|
||||
// pValue - Contains the value to be written.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to write the specified CRect value into
|
||||
// the specified section of the application<6F>s registry or .INI file.
|
||||
BOOL WriteProfileRect(LPCTSTR lpszSection,LPCTSTR lpszEntry,CRect * pValue);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry. If the section does not exist, it is created.
|
||||
// The name of the section is case independent. The string may be any
|
||||
// combination of uppercase and lowercase letters.
|
||||
// lpszEntry - Points to a null-terminated string that contains the entry into
|
||||
// which the value is to be written. If the entry does not exist in
|
||||
// the specified section, it is created.
|
||||
// pValue - Contains the value to be written.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to write the specified CSize value into
|
||||
// the specified section of the application<6F>s registry or .INI file.
|
||||
BOOL WriteProfileSize(LPCTSTR lpszSection,LPCTSTR lpszEntry,CSize * pValue);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry. If the section does not exist, it is created.
|
||||
// The name of the section is case independent. The string may be any
|
||||
// combination of uppercase and lowercase letters.
|
||||
// lpszEntry - Points to a null-terminated string that contains the entry into
|
||||
// which the value is to be written. If the entry does not exist in
|
||||
// the specified section, it is created.
|
||||
// pValue - Contains the value to be written.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to write the specified double/float value
|
||||
// into the specified section of the application<6F>s registry or .INI file.
|
||||
BOOL WriteProfileDouble(LPCTSTR lpszSection,LPCTSTR ,double * pValue);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry. If the section does not exist, it is created.
|
||||
// The name of the section is case independent. The string may be any
|
||||
// combination of uppercase and lowercase letters.
|
||||
// lpszEntry - Points to a null-terminated string that contains the entry into
|
||||
// which the value is to be written. If the entry does not exist in
|
||||
// the specified section, it is created.
|
||||
// pValue - Contains the value to be written.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to write the specified DWORD value into
|
||||
// the specified section of the application<6F>s registry or .INI file.
|
||||
//
|
||||
// Note that as COLORREF is a typedef for a DWORD, WriteProfileColor calls
|
||||
// this function.
|
||||
BOOL WriteProfileDword(LPCTSTR lpszSection,LPCTSTR lpszEntry,DWORD * pValue);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry. If the section does not exist, it is created.
|
||||
// The name of the section is case independent. The string may be any
|
||||
// combination of uppercase and lowercase letters.
|
||||
// lpszEntry - Points to a null-terminated string that contains the entry into
|
||||
// which the value is to be written. If the entry does not exist in
|
||||
// the specified section, it is created.
|
||||
// pValue - Contains the value to be written.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to write the specified COLORREF value
|
||||
// into the specified section of the application<6F>s registry or .INI file.
|
||||
//
|
||||
// Note that as COLORREF is a typedef for a DWORD, this function just
|
||||
// calls WriteProfileDword.
|
||||
BOOL WriteProfileColor(LPCTSTR lpszSection,LPCTSTR lpszEntry,COLORREF * pValue);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry.
|
||||
// lpszEntry - Points to a null-terminated string that contains the entry whose
|
||||
// value is to be retrieved.
|
||||
// nDefault - Specifies the default value to return if the framework cannot
|
||||
// find the entry. This value can be an unsigned value in the range 0
|
||||
// through 65,535 or a signed value in the range <20>32,768 through 32,767.
|
||||
// Returns: The integer value of the string that follows the
|
||||
// specified entry if the function is successful. The return value is
|
||||
// the value of the 'nDefault' parameter if the function does not find the
|
||||
// entry. The return value is zero if the value that corresponds to the
|
||||
// specified entry is not an integer.
|
||||
// Summary: Call this member function to retrieve the value of an integer from
|
||||
// an entry within a specified section of the application<6F>s registry or
|
||||
// .INI file.
|
||||
//
|
||||
// This member function supports hexadecimal notation for the value
|
||||
// in the .INI file. When you retrieve a signed integer, you should cast
|
||||
// the value into an int.
|
||||
UINT GetProfileInt(LPCTSTR lpszSection,LPCTSTR lpszEntry,int nDefault);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry.
|
||||
// lpszEntry - Points to a null-terminated string that contains the entry whose
|
||||
// value is to be retrieved.
|
||||
// ppData - Address of a LPBYTE data member to receive the value. It is the
|
||||
// caller's responsibility to free the memory allocated for 'ppData'.
|
||||
// An example of this would be:
|
||||
//
|
||||
// <pre>
|
||||
// void CXTDockWindow::LoadBarSize(CString strSection)
|
||||
// {
|
||||
// XT_MANAGE_STATE; // Switch to toolkit resources/module state
|
||||
//
|
||||
// // restore the previous bar style.
|
||||
// if(::IsWindow(m_hWnd))
|
||||
// {
|
||||
// UINT nSize = 0;
|
||||
// LPBYTE pbtData = 0;
|
||||
// CString string;
|
||||
// string.LoadString(XT_IDS_REG_BARPOS);
|
||||
//
|
||||
// CXTRegistryManager regManager;
|
||||
// if (regManager.GetProfileBinary( strSection,
|
||||
// string, &pbtData, &nSize))
|
||||
// {
|
||||
// XT_BARPLACEMENT* pBP =
|
||||
// reinterpret_cast<XT_BARPLACEMENT*>(pbtData);
|
||||
//
|
||||
// SetBarPlacement(pBP);
|
||||
// <b>delete [] pbtData;</b>
|
||||
// }
|
||||
// }
|
||||
// }</pre>
|
||||
// pBytes - Address of a UINT to receive the size of 'ppData'.
|
||||
// Returns: Nonzero if successful, otherwise returns zero.
|
||||
// Summary: Call this member function to retrieve the binary value from an entry
|
||||
// within a specified section of the application<6F>s registry or .INI file.
|
||||
BOOL GetProfileBinary(LPCTSTR lpszSection,LPCTSTR lpszEntry,BYTE** ppData,UINT* pBytes);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry.
|
||||
// lpszEntry - Points to a null-terminated string that contains the entry whose
|
||||
// value is to be retrieved.
|
||||
// lpszDefault - Points to the default string value for the given entry if the
|
||||
// entry cannot be found in the initialization file.
|
||||
// Returns: The string associated with an entry within the specified section in the
|
||||
// application<6F>s registry or .INI file. The return value is the string from the
|
||||
// application<6F>s .INI file or 'lpszDefault' if the string cannot be found.
|
||||
// Summary: Call this member function to retrieve the string associated with
|
||||
// an entry within the specified section in the application<6F>s registry
|
||||
// or .INI file. The return value is the string from the application<6F>s
|
||||
// .INI file or 'lpszDefault' if the string cannot be found. The maximum
|
||||
// string length supported by the framework is _MAX_PATH. If 'lpszDefault'
|
||||
// is NULL, the return value is an empty string.
|
||||
CString GetProfileString(LPCTSTR lpszSection,LPCTSTR lpszEntry,LPCTSTR lpszDefault);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry.
|
||||
// lpszEntry - Points to a null-terminated string that contains the entry whose
|
||||
// value is to be retrieved.
|
||||
// ptResult - Points to the variable to be filled from the registry.
|
||||
// Returns: TRUE if the function succeeds, and FALSE otherwise.
|
||||
// Summary: Call this member function to retrieve the value of a CPoint from
|
||||
// an entry within a specified section of the application<6F>s registry or
|
||||
// .INI file. Retrieves the CPoint value that follows the specified entry
|
||||
// if the function is successful.
|
||||
BOOL GetProfilePoint(LPCTSTR lpszSection,LPCTSTR lpszEntry,CPoint * ptResult);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry.
|
||||
// lpszEntry - Points to a null-terminated string that contains the entry whose
|
||||
// value is to be retrieved.
|
||||
// rcResult - Points to the variable to be filled from the registry.
|
||||
// Returns: TRUE if the function succeeds, and FALSE otherwise.
|
||||
// Summary: Call this member function to retrieve the value of a CRect from
|
||||
// an entry within a specified section of the application<6F>s registry or
|
||||
// .INI file. Retrieves the CRect value that follows the specified entry
|
||||
// if the function is successful.
|
||||
BOOL GetProfileRect(LPCTSTR lpszSection,LPCTSTR lpszEntry,CRect * rcResult);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry.
|
||||
// lpszEntry - Points to a null-terminated string that contains the entry whose
|
||||
// value is to be retrieved.
|
||||
// rcResult - Points to the variable to be filled from the registry.
|
||||
// Returns: TRUE if the function succeeds, and FALSE otherwise.
|
||||
// Summary: Call this member function to retrieve the value of a CSize from
|
||||
// an entry within a specified section of the application<6F>s registry or
|
||||
// .INI file. Retrieves the CSize value that follows the specified entry
|
||||
// if the function is successful.
|
||||
BOOL GetProfileSize(LPCTSTR lpszSection,LPCTSTR lpszEntry,CSize * rcResult);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry.
|
||||
// lpszEntry - Points to a null-terminated string that contains the entry whose
|
||||
// value is to be retrieved.
|
||||
// rcResult - Points to the variable to be filled from the registry.
|
||||
// Returns: TRUE if the function succeeds, and FALSE otherwise.
|
||||
// Summary: Call this member function to retrieve the value of a double from
|
||||
// an entry within a specified section of the application<6F>s registry or
|
||||
// .INI file. Retrieves the value that follows the specified entry if the
|
||||
// function is successful.
|
||||
BOOL GetProfileDouble(LPCTSTR lpszSection,LPCTSTR lpszEntry,double * rcResult);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry.
|
||||
// lpszEntry - Points to a null-terminated string that contains the entry whose
|
||||
// value is to be retrieved.
|
||||
// rcResult - Points to the variable to be filled from the registry.
|
||||
// Returns: TRUE if the function succeeds, and FALSE otherwise.
|
||||
// Summary: Call this member function to retrieve the value of a DWORD from
|
||||
// an entry within a specified section of the application<6F>s registry or
|
||||
// .INI file. Retrieves the value that follows the specified entry if the
|
||||
// function is successful.
|
||||
//
|
||||
// Note that as COLORREF is a typedef for a DWORD, GetProfileColor calls
|
||||
// this function.
|
||||
BOOL GetProfileDword(LPCTSTR lpszSection,LPCTSTR lpszEntry,DWORD * rcResult);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry.
|
||||
// lpszEntry - Points to a null-terminated string that contains the entry whose
|
||||
// value is to be retrieved.
|
||||
// rcResult - Points to the variable to be filled from the registry.
|
||||
// Returns: TRUE if the function succeeds, and FALSE otherwise.
|
||||
// Summary: Call this member function to retrieve the value of a COLORREF from
|
||||
// an entry within a specified section of the application<6F>s registry or
|
||||
// .INI file. Retrieves the value that follows the specified entry if the
|
||||
// function is successful.
|
||||
//
|
||||
// Note that as COLORREF is a typedef for a DWORD, this function just
|
||||
// calls GetProfileDword.
|
||||
BOOL GetProfileColor(LPCTSTR lpszSection,LPCTSTR lpszEntry,COLORREF * rcResult);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section containing
|
||||
// the entry.
|
||||
// mapItems - A reference to a CMap<CString, LPCTSTR, DWORD, DWORD&>, which will contain
|
||||
// the items in the registry under this section. Can be NULL.
|
||||
// Does not include subsection names.
|
||||
// arrayNames - A reference to a CStringArray which, if not NULL, will contain an array
|
||||
// of names in the order they were read from the registry.
|
||||
// Returns: Zero if section is empty, otherwise it returns the number of values
|
||||
// present.
|
||||
// Summary: Call this function to fill a CMap (CString to DWORD) with the names
|
||||
// and value types under a specific registry section. The DWORD values
|
||||
// returned are as follows:
|
||||
// [ul]
|
||||
// [li]<b>REG_BINARY</b> Binary data in any form.[/li]
|
||||
// [li]<b>REG_DWORD</b> A 32-bit number.[/li]
|
||||
// [li]<b>REG_DWORD_LITTLE_ENDIAN</b> A 32-bit number in little-endian format.
|
||||
// This is equivalent to REG_DWORD. In little-endian format, a
|
||||
// multi-byte value is stored in memory from the lowest byte (the
|
||||
// "little end") to the highest byte. For example, the value 0x12345678
|
||||
// is stored as (0x78 0x56 0x34 0x12) in little-endian format.
|
||||
// Windows NT/Windows 2000, Windows 95, and Windows 98 are designed
|
||||
// to run on little-endian computer architectures. A user may
|
||||
// connect to computers that have big-endian architectures, such
|
||||
// as some UNIX systems.[/li]
|
||||
// [li]<b>REG_DWORD_BIG_ENDIAN</b> A 32-bit number in big-endian format.
|
||||
// In big-endian format, a multi-byte value is stored in memory
|
||||
// from the highest byte (the "big end") to the lowest byte. For
|
||||
// example, the value 0x12345678 is stored as (0x12 0x34 0x56 0x78)
|
||||
// in big-endian format.[/li]
|
||||
// [li]<b>REG_EXPAND_SZ</b> A null-terminated string that contains unexpanded
|
||||
// references to environment variables (for example, "%PATH%").
|
||||
// It will be a Unicode or ANSI string depending on whether you
|
||||
// use the Unicode or ANSI functions. To expand the environment
|
||||
// variable references, use the ExpandEnvironmentStrings function.[/li]
|
||||
// [li]<b>REG_LINK</b> A Unicode symbolic link. Used internally. Applications
|
||||
// should <b>not</b> use this type.[/li]
|
||||
// [li]<b>REG_MULTI_SZ</b> An array of null-terminated strings, terminated
|
||||
// by two null characters.[/li]
|
||||
// [li]<b>REG_NONE</b> No defined value type.[/li]
|
||||
// [li]<b>REG_QWORD</b> A 64-bit number.[/li]
|
||||
// [li]<b>REG_QWORD_LITTLE_ENDIAN</b> A 64-bit number in little-endian
|
||||
// format. This is equivalent to REG_QWORD.[/li]
|
||||
// [li]<b>REG_RESOURCE_LIST</b> A device-driver resource list.[/li]
|
||||
// [li]<b>REG_SZ</b> A null-terminated string. It will be a Unicode
|
||||
// or ANSI string, depending on whether you use the Unicode or
|
||||
// ANSI functions.[/li]
|
||||
// [/ul]
|
||||
// The function also takes a pointer to a CStringArray, because CMap is
|
||||
// a sorted container, and therefore it is not possible to get the items
|
||||
// in the order they appeared from it.
|
||||
//
|
||||
// Pass NULL for the CStringArray* if you don't want to use it, and NULL
|
||||
// into the CMap if you only require a list of the item names.
|
||||
int EnumValues(LPCTSTR lpszSection,CMap<CString, LPCTSTR, DWORD, DWORD&> * mapItems,CStringArray * arrayNames);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry.
|
||||
// arrayKeys - A reference to a CStringArray, which will contain the keys in the
|
||||
// registry under the above key.
|
||||
// Summary: Call this function to fill a CStringArray with the names of keys below
|
||||
// the key specified. The return value indicates the number of keys found
|
||||
// by the function, which can be used to check if any were found.
|
||||
// CStringArray::GetSize will give the same result if needed, assuming
|
||||
// the array is zeroed when it goes in. The function does not zero it,
|
||||
// leaving the possibility of getting a list of subkeys of more than one
|
||||
// key, for whatever reason.
|
||||
int EnumKeys(LPCTSTR lpszSection,CStringArray & arrayKeys);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry.
|
||||
// lpszKey - Points to a null-terminated string that specifies the subkey to delete.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this function to delete a registry key, and all its contents.
|
||||
bool DeleteKey(LPCTSTR lpszSection,LPCTSTR lpszKey);
|
||||
|
||||
// Input: lpszSection - Points to a null-terminated string that specifies the section
|
||||
// containing the entry.
|
||||
// lpszKey - Points to a null-terminated string that specifies the value to delete.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Call this function to delete a registry value.
|
||||
bool DeleteValue(LPCTSTR lpszSection,LPCTSTR lpszKey);
|
||||
|
||||
protected:
|
||||
|
||||
virtual HKEY GetAppRegistryKey();
|
||||
virtual HKEY GetSectionKey(LPCTSTR lpszSection);
|
||||
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTRegistryManager::SetINIFileName(CString strINIFileName) {
|
||||
m_strINIFileName = strINIFileName;
|
||||
}
|
||||
AFX_INLINE CString CXTRegistryManager::GetINIFileName() {
|
||||
return m_strINIFileName;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // __XTREGISTRYMANAGER_H__
|
||||
359
Editor/XT/Include/XTResize.h
Normal file
359
Editor/XT/Include/XTResize.h
Normal file
@@ -0,0 +1,359 @@
|
||||
// XTResize.h: interface for the CXTResize class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//--------------------------------------------------------------------
|
||||
// Based on the resizable classes created by Torben B. Haagh. Used by permission.
|
||||
// http://www.codeguru.com/dialog/torbenResizeDialog.shtml
|
||||
//--------------------------------------------------------------------
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTRESIZE_H__)
|
||||
#define __XTRESIZE_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: The XT_SIZING structure is a stand alone helper structure class. It
|
||||
// is used by the CXTResize class to maintain size and ID for a particular
|
||||
// window being sized.
|
||||
struct XT_SIZING
|
||||
{
|
||||
UINT id; // Control identifier of the window sized.
|
||||
XT_RESIZERECT rrc; // Size of the window sized.
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: The CXTSizeIcon class is a CStatic derived helper class. It is used
|
||||
// by CXTResize to display the sizing grip in the lower right corner of
|
||||
// a sizing window.
|
||||
class _XT_EXT_CLASS CXTSizeIcon : public CStatic
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTSizeIcon object.
|
||||
CXTSizeIcon();
|
||||
|
||||
protected:
|
||||
|
||||
HCURSOR m_hCursor; // Handle to the cursor displayed for the size icon.
|
||||
CBitmap m_bmSizeIcon; // Size icon bitmap
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTSizeIcon)
|
||||
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTItem is a stand alone helper class. It is used by CXTResize to
|
||||
// maintain information about each item to be sized or moved.
|
||||
class _XT_EXT_CLASS CXTItem
|
||||
{
|
||||
public:
|
||||
|
||||
// Input: pwnd - Pointer to the window to be sized or moved.
|
||||
// rrcSizing - Reference to a CXTResizeRect object.
|
||||
// rcWindow - Reference to a CRect object.
|
||||
// bDeleteWnd - TRUE if the window is to be deleted.
|
||||
// Summary: Constructs a CXTItem object.
|
||||
CXTItem(CWnd* pwnd,const CXTResizeRect& rrcSizing,CRect& rcWindow,BOOL bDeleteWnd);
|
||||
|
||||
// Summary: Destroys a CXTItem object, handles cleanup and de-allocation.
|
||||
virtual ~CXTItem();
|
||||
|
||||
BOOL m_bDeleteWnd; // TRUE if the window is to be deleted
|
||||
BOOL m_bInitialSize; // Initial size/move has been completed.
|
||||
CWnd* m_pwnd; // A pointer to the window to be sized or moved.
|
||||
CXTResizeRect m_rrcSizing; // Sizing option.
|
||||
CXTResizeRect m_rrcWindow; // Last control size.
|
||||
CXTResizeRect m_rrcInitWindow; // Initial control size.
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTResize is a base class. It is used by resizing dialogs, property
|
||||
// sheets, and form views. It acts as a manager to maintain size and location
|
||||
// of the dialog and dialog items.
|
||||
class _XT_EXT_CLASS CXTResize
|
||||
{
|
||||
public:
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: object - Points to the parent or owner window object, of type CWnd, to which the
|
||||
// resizing object belongs.
|
||||
// nFlags - Flags that are to be passed to CXTResize that specify the attributes
|
||||
// of the resizing property page. They can be one or more of the following,
|
||||
// and can be combined using the or (|) operator:
|
||||
// [ul]
|
||||
// [li]<b>SZ_NOSIZEICON</b> Do not add size icon.[/li]
|
||||
// [li]<b>SZ_NOHORISONTAL</b> No horizontal resizing.[/li]
|
||||
// [li]<b>SZ_NOVERTICAL</b> No vertical resizing.[/li]
|
||||
// [li]<b>SZ_NOMINSIZE</b> Do not require a minimum size.[/li]
|
||||
// [li]<b>SZ_NOCLIPCHILDREN</b> Do not set clip children style.[/li]
|
||||
// [li]<b>SZ_NOTRANSPARENTGROUP</b> Do not set transparent style
|
||||
// for group boxes.[/li]
|
||||
// [/ul]
|
||||
// Summary: Constructs a CXTResize object.
|
||||
CXTResize(CWnd* pwnd,const UINT nFlags = 0);
|
||||
|
||||
// Summary: Destroys a CXTResize object, handles cleanup and de-allocation.
|
||||
virtual ~CXTResize();
|
||||
|
||||
// Input: nID - Specifies the control's ID.
|
||||
// left - How much the left side will move when the dialog is resized.
|
||||
// top - How much the top side will move when the dialog is resized.
|
||||
// right - How much the right side will move when the dialog is resized.
|
||||
// bottom - How much the bottom side will move when the dialog is resized.
|
||||
// Summary: The SetResize function specifies how much each side of a control will
|
||||
// move when the dialog is resized. If a control should be repositioned
|
||||
// (e.g. an OK button) then all four sides should move by the same amount
|
||||
// of pixels, as the dialog is resized. If a control should be resized
|
||||
// just as much as the dialog (e.g. the list control in the file dialog),
|
||||
// then the left and top sides shouldn't move, and the right and bottom
|
||||
// sides should move by the same amount of pixels as the dialog.
|
||||
void SetResize(const UINT nID,XT_RESIZE left,XT_RESIZE top,XT_RESIZE right,XT_RESIZE bottom);
|
||||
|
||||
// Input: nID - Specifies the control's ID.
|
||||
// rrcSizing - How much the left, top, right and bottom sides will move when
|
||||
// the dialog is resized.
|
||||
// Summary: The SetResize function specifies how much each side of a control will
|
||||
// move when the dialog is resized. If a control should be repositioned
|
||||
// (e.g. an OK button) then all four sides should move by the same amount
|
||||
// of pixels, as the dialog is resized. If a control should be resized
|
||||
// just as much as the dialog (e.g. the list control in the file dialog),
|
||||
// then the left and top sides shouldn't move, and the right and bottom
|
||||
// sides should move by the same amount of pixels as the dialog.
|
||||
void SetResize(const UINT nID,const XT_RESIZERECT& rrcSizing);
|
||||
|
||||
// Input: nID - Specifies the control's ID.
|
||||
// hWnd - HWND of the dialog item to be sized.
|
||||
// rrcSizing - How much the left, top, right and bottom sides will move when
|
||||
// the dialog is resized.
|
||||
// Summary: The SetResize function specifies how much each side of a control will
|
||||
// move when the dialog is resized. If a control should be repositioned
|
||||
// (e.g. an OK button) then all four sides should move by the same amount
|
||||
// of pixels, as the dialog is resized. If a control should be resized
|
||||
// just as much as the dialog (e.g. the list control in the file dialog),
|
||||
// then the left and top sides shouldn't move, and the right and bottom
|
||||
// sides should move by the same amount of pixels as the dialog.
|
||||
void SetResize(const UINT nID,const HWND hWnd,const XT_RESIZERECT& rrcSizing);
|
||||
|
||||
// Input: nID - Specifies the control's ID.
|
||||
// hWnd - HWND of the dialog item to be sized.
|
||||
// rpTopLeft - How much the top and left sides will move when the dialog is resized.
|
||||
// rpBottomRight - How much the bottom and right sides will move when the dialog is resized.
|
||||
// Summary: The SetResize function specifies how much each side of a control will
|
||||
// move when the dialog is resized. If a control should be repositioned
|
||||
// (e.g. an OK button) then all four sides should move by the same amount
|
||||
// of pixels, as the dialog is resized. If a control should be resized
|
||||
// just as much as the dialog (e.g. the list control in the file dialog),
|
||||
// then the left and top sides shouldn't move, and the right and bottom
|
||||
// sides should move by the same amount of pixels as the dialog.
|
||||
void SetResize(const UINT nID,const HWND hWnd,const XT_RESIZEPOINT& rpTopLeft,const XT_RESIZEPOINT& rpBottomRight);
|
||||
|
||||
// Input: nID - Specifies the control's ID.
|
||||
// rpTopLeft - How much the top and left sides will move when the dialog is resized.
|
||||
// rpBottomRight - How much the bottom and right sides will move when the dialog is resized.
|
||||
// Summary: The SetResize function specifies how much each side of a control will
|
||||
// move when the dialog is resized. If a control should be repositioned
|
||||
// (e.g. an OK button) then all four sides should move by the same amount
|
||||
// of pixels, as the dialog is resized. If a control should be resized
|
||||
// just as much as the dialog (e.g. the list control in the file dialog),
|
||||
// then the left and top sides shouldn't move, and the right and bottom
|
||||
// sides should move by the same amount of pixels as the dialog.
|
||||
void SetResize(const UINT nID,const XT_RESIZEPOINT& rpTopLeft,const XT_RESIZEPOINT& rpBottomRight);
|
||||
|
||||
// Input: arr[] - Array of XT_SIZING structures that specify how much the left, top,
|
||||
// right and bottom sides of the dialog item will move when the dialog
|
||||
// is resized.
|
||||
// Summary: The SetResize function specifies how much each side of a control will
|
||||
// move when the dialog is resized. If a control should be repositioned
|
||||
// (e.g. an OK button) then all four sides should move by the same amount
|
||||
// of pixels, as the dialog is resized. If a control should be resized
|
||||
// just as much as the dialog (e.g. the list control in the file dialog),
|
||||
// then the left and top sides shouldn't move, and the right and bottom
|
||||
// sides should move by the same amount of pixels as the dialog.
|
||||
void SetResize(XT_SIZING arr[]);
|
||||
|
||||
// Input: sz - Specifies the minimum width and height the dialog can be sized to.
|
||||
// Summary: This member function sets the minimum size explicitly. Initial size
|
||||
// is the default.
|
||||
void SetMinSize(CSize& sz);
|
||||
|
||||
// Input: sz - Specifies the maximum width and height the dialog can be sized to.
|
||||
// Summary: This member function sets the maximum size. No maximum is the default.
|
||||
void SetMaxSize(CSize& sz);
|
||||
|
||||
// Input: pszSection - Name of a section in the initialization file or a key in the Windows
|
||||
// registry where placement information is stored.
|
||||
// Summary: This member function saves the window placement to the registry.
|
||||
void SavePlacement(LPCTSTR pszSection);
|
||||
|
||||
// Input: pszSection - Name of a section in the initialization file or a key in the Windows
|
||||
// registry where placement information is stored.
|
||||
// Summary: This member function loads saved window placement information from
|
||||
// the registry.
|
||||
void LoadPlacement(LPCTSTR pszSection);
|
||||
|
||||
// Input: pszSection - Name of a section in the initialization file or a key in the Windows
|
||||
// registry where placement information is stored.
|
||||
// Summary: This member function loads saved window placement information from
|
||||
// the registry. This version is the same as LoadPlacement, but there
|
||||
// is no need for calling SavePlacement when the window is destroyed,
|
||||
// this will be called automatically.
|
||||
void AutoLoadPlacement(LPCTSTR pszSection);
|
||||
|
||||
protected:
|
||||
|
||||
// Input: pwnd - Points to the dialog item to be resized.
|
||||
// rrcSizing - How much the left, top, right, and bottom sides will move when the
|
||||
// dialog is resized.
|
||||
// rcWindow - Initial size of the dialog item.
|
||||
// Summary: This member function is used by the resize manager to add a dialog
|
||||
// item to the list of items to be resized.
|
||||
void SetResize(CWnd* pwnd,const CXTResizeRect& rrcSizing,CRect rcWindow);
|
||||
|
||||
// Input: nID - Specifies the control's ID.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function is called to remove the specified dialog item
|
||||
// from the list of items to be resized.
|
||||
BOOL RemoveResize(const UINT nID);
|
||||
|
||||
// Summary: This member function is called to purge the list that contains dialog
|
||||
// items to be sized.
|
||||
void RemoveAllControls();
|
||||
|
||||
// Summary: This member function is called from OnInitDialog or OnInitialUpdate
|
||||
// to initialize the resize manager.
|
||||
void Init();
|
||||
|
||||
// Summary: This member function is called from OnSize to move and resize the dialog
|
||||
// items that are managed.
|
||||
void Size();
|
||||
|
||||
// Summary: This member function is called, when a property sheet in wizard mode
|
||||
// has changed pages, to alert the resize manager that the property sheet
|
||||
// (common control) has moved the page back to its original size/position
|
||||
// on the sheet.
|
||||
void Reset();
|
||||
|
||||
// Input: pMMI - Points to a MINMAXINFO structure that contains information about a
|
||||
// window<6F>s maximized size and position, and its minimum and maximum
|
||||
// tracking size. For more information about this structure, see the
|
||||
// MINMAXINFO structure.
|
||||
// Summary: This member function is called from OnGetMinMaxInfo to get the
|
||||
// maximized position or dimensions, or the minimum or maximum tracking
|
||||
// size. The maximized size is the size of the window when its borders
|
||||
// are fully extended. The maximum tracking size of the window is the
|
||||
// largest window size that can be achieved by using the borders to size
|
||||
// the window. The minimum tracking size of the window is the smallest
|
||||
// window size that can be achieved by using the borders to size the window.
|
||||
void GetMinMaxInfo(MINMAXINFO* pMMI);
|
||||
|
||||
protected: // flags
|
||||
|
||||
// Summary: Style attributes for the resizing dialog, property sheet, or form view.
|
||||
enum EFlags
|
||||
{
|
||||
SZ_NOSIZEICON = 0x01, // Do not add size icon.
|
||||
SZ_NOHORISONTAL = 0x02, // No horizontal resizing.
|
||||
SZ_NOVERTICAL = 0x04, // No vertical resizing.
|
||||
SZ_NOMINSIZE = 0x08, // Do not require a minimum size.
|
||||
SZ_NOCLIPCHILDREN = 0x10, // Do not set clip children style.
|
||||
SZ_NOTRANSPARENTGROUP = 0x20, // Do not set transparent style for group boxes.
|
||||
};
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: eFlag - Flag to check. It can be one of the following:
|
||||
// [ul]
|
||||
// [li]<b>SZ_NOSIZEICON</b> Do not add size icon.[/li]
|
||||
// [li]<b>SZ_NOHORISONTAL</b> No horizontal resizing.[/li]
|
||||
// [li]<b>SZ_NOVERTICAL</b> No vertical resizing.[/li]
|
||||
// [li]<b>SZ_NOMINSIZE</b> Do not require a minimum size.[/li]
|
||||
// [li]<b>SZ_NOCLIPCHILDREN</b> Do not set clip children style.[/li]
|
||||
// [li]<b>SZ_NOTRANSPARENTGROUP</b> Do not set transparent style
|
||||
// for group boxes.[/li]
|
||||
// [/ul]
|
||||
// Returns: TRUE if the specified flag has been set, otherwise returns FALSE.
|
||||
// Summary: This member function is called to determine if the specified flag
|
||||
// has been set for the resize manager.
|
||||
BOOL HasFlag(EFlags eFlag);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: eFlag - Flag to set. It can be one of the following:
|
||||
// [ul]
|
||||
// [li]<b>SZ_NOSIZEICON</b> Do not add size icon.[/li]
|
||||
// [li]<b>SZ_NOHORISONTAL</b> No horizontal resizing.[/li]
|
||||
// [li]<b>SZ_NOVERTICAL</b> No vertical resizing.[/li]
|
||||
// [li]<b>SZ_NOMINSIZE</b> Do not require a minimum size.[/li]
|
||||
// [li]<b>SZ_NOCLIPCHILDREN</b> Do not set clip children style.[/li]
|
||||
// [li]<b>SZ_NOTRANSPARENTGROUP</b> Do not set transparent style
|
||||
// for group boxes.[/li]
|
||||
// [/ul]
|
||||
// Summary: This member function is called to set a specific flag for the resize
|
||||
// manager.
|
||||
void SetFlag(EFlags eFlag);
|
||||
|
||||
protected: // helper methods
|
||||
|
||||
BOOL Defer(HDWP&, CXTItem*, int dx, int dy);
|
||||
|
||||
protected: // helper data
|
||||
|
||||
typedef CArray<CXTItem*, CXTItem*&> CXTItemArray;
|
||||
|
||||
UINT m_nFlagsXX; // flags passed from constructor
|
||||
CWnd* m_pwnd; // the associative relation to the window to be resized
|
||||
CRect m_rcWindow; // last dialog size
|
||||
CRect m_rcInitWindow; // Initial dialog size
|
||||
CSize m_szMin; // smallest size allowed
|
||||
CSize m_szMax; // largest size allowed
|
||||
CString m_strSection; // section in registry where window placement information is saved.
|
||||
CXTSizeIcon m_scSizeIcon; // size icon window
|
||||
CXTItemArray m_arrItems; // array of controls
|
||||
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTResize::SetMinSize(CSize& sz) {
|
||||
m_szMin = sz;
|
||||
}
|
||||
AFX_INLINE void CXTResize::SetMaxSize(CSize& sz) {
|
||||
m_szMax = sz;
|
||||
}
|
||||
AFX_INLINE BOOL CXTResize::HasFlag(EFlags eFlag) {
|
||||
return (m_nFlagsXX & eFlag) != 0;
|
||||
}
|
||||
AFX_INLINE void CXTResize::SetResize(const UINT nID, const HWND hWnd, const XT_RESIZEPOINT& rpTopLeft, const XT_RESIZEPOINT& rpBottomRight) {
|
||||
SetResize(nID, hWnd, CXTResizeRect(rpTopLeft.x, rpTopLeft.y, rpBottomRight.x, rpBottomRight.y));
|
||||
}
|
||||
AFX_INLINE void CXTResize::SetResize(const UINT nID, const XT_RESIZERECT& rrcSizing) {
|
||||
SetResize(nID,NULL,rrcSizing);
|
||||
}
|
||||
AFX_INLINE void CXTResize::SetResize(const UINT nID, const XT_RESIZEPOINT& rpTopLeft, const XT_RESIZEPOINT& rpBottomRight) {
|
||||
SetResize(nID, CXTResizeRect(rpTopLeft.x, rpTopLeft.y, rpBottomRight.x, rpBottomRight.y));
|
||||
}
|
||||
AFX_INLINE void CXTResize::SetResize(const UINT nID, XT_RESIZE left, XT_RESIZE top, XT_RESIZE right, XT_RESIZE bottom) {
|
||||
SetResize(nID, CXTResizeRect(left, top, right, bottom));
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // !defined(__XTRESIZE_H__)
|
||||
73
Editor/XT/Include/XTResizeDialog.h
Normal file
73
Editor/XT/Include/XTResizeDialog.h
Normal file
@@ -0,0 +1,73 @@
|
||||
// XTResizeDialog.h: interface for the CXTResizeDialog class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//--------------------------------------------------------------------
|
||||
// Based on the resizable classes created by Torben B. Haagh. Used by permission.
|
||||
// http://www.codeguru.com/dialog/torbenResizeDialog.shtml
|
||||
//--------------------------------------------------------------------
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTRESIZEDIALOG_H__)
|
||||
#define __XTRESIZEDIALOG_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTResizeDialog is a multiple inheritance class derived from CDialog
|
||||
// and CXTResize. CXTResizeDialog is used to create a resizable CDialog
|
||||
// type object that allows its dialog items to be resized or moved dynamically.
|
||||
class _XT_EXT_CLASS CXTResizeDialog : public CDialog, public CXTResize
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTResizeDialog);
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTResizeDialog object.
|
||||
CXTResizeDialog();
|
||||
|
||||
// Input: nID - Contains the ID number of a dialog box template resource.
|
||||
// pParent - Points to the parent or owner window object, of type CWnd, to which
|
||||
// the dialog object belongs. If it is NULL, the dialog object<63>s parent
|
||||
// window is set to the main application window.
|
||||
// nFlags - Flags that are to be passed to CXTResize that specify the attributes
|
||||
// of the resizing property page. They can be one or more of the following,
|
||||
// and can be combined using the or (|) operator:
|
||||
// [ul]
|
||||
// [li]<b>SZ_NOSIZEICON</b> Do not add size icon.[/li]
|
||||
// [li]<b>SZ_NOHORISONTAL</b> No horizontal resizing.[/li]
|
||||
// [li]<b>SZ_NOVERTICAL</b> No vertical resizing.[/li]
|
||||
// [li]<b>SZ_NOMINSIZE</b> Do not require a minimum size.[/li]
|
||||
// [li]<b>SZ_NOCLIPCHILDREN</b> Do not set clip children style.[/li]
|
||||
// [li]<b>SZ_NOTRANSPARENTGROUP</b> Do not set transparent style
|
||||
// for group boxes.[/li]
|
||||
// [/ul]
|
||||
// Summary: Constructs a CXTResizeDialog object.
|
||||
CXTResizeDialog(const UINT nID,CWnd* pParent = 0,const UINT nFlags = 0);
|
||||
|
||||
protected:
|
||||
|
||||
UINT m_nDialogID; // Contains the ID number of a dialog box template resource.
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTResizeDialog)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg void OnGetMinMaxInfo(MINMAXINFO *lpMMI);
|
||||
afx_msg void OnDestroy();
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // !defined(__XTRESIZEDIALOG_H__)
|
||||
71
Editor/XT/Include/XTResizeFormView.h
Normal file
71
Editor/XT/Include/XTResizeFormView.h
Normal file
@@ -0,0 +1,71 @@
|
||||
// XTResizeFormView.h: interface for the CXTResizeFormView class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//--------------------------------------------------------------------
|
||||
// Based on the resizable classes created by Torben B. Haagh. Used by permission.
|
||||
// http://www.codeguru.com/dialog/torbenResizeDialog.shtml
|
||||
//--------------------------------------------------------------------
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTRESIZEFORMVIEW_H__)
|
||||
#define __XTRESIZEFORMVIEW_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTResizeFormView is a multiple inheritance class derived from CFormView
|
||||
// and CXTResize. CXTResizeFormView is used to create a resizable CFormView
|
||||
// type object that allows its form items to be resized or moved dynamically.
|
||||
class _XT_EXT_CLASS CXTResizeFormView : public CFormView, public CXTResize
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTResizeFormView)
|
||||
|
||||
public:
|
||||
|
||||
// Input: nID - Contains the ID number of a dialog template resource.
|
||||
// nFlags - Flags that are to be passed to CXTResize that specify the attributes
|
||||
// of the resizing property page. They can be one or more of the following,
|
||||
// and can be combined using the or (|) operator:
|
||||
// [ul]
|
||||
// [li]<b>SZ_NOSIZEICON</b> Do not add size icon.[/li]
|
||||
// [li]<b>SZ_NOHORISONTAL</b> No horizontal resizing.[/li]
|
||||
// [li]<b>SZ_NOVERTICAL</b> No vertical resizing.[/li]
|
||||
// [li]<b>SZ_NOMINSIZE</b> Do not require a minimum size.[/li]
|
||||
// [li]<b>SZ_NOCLIPCHILDREN</b> Do not set clip children style.[/li]
|
||||
// [li]<b>SZ_NOTRANSPARENTGROUP</b> Do not set transparent style
|
||||
// for group boxes.[/li]
|
||||
// [/ul]
|
||||
// Summary: Constructs a CXTResizeFormView object.
|
||||
CXTResizeFormView(const UINT nID = 0,const UINT nFlags = 0);
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTResizeFormView)
|
||||
protected:
|
||||
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTResizeFormView)
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg void OnGetMinMaxInfo(MINMAXINFO *lpMMI);
|
||||
afx_msg void OnDestroy();
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // !defined(__XTRESIZEFORMVIEW_H__)
|
||||
67
Editor/XT/Include/XTResizePoint.h
Normal file
67
Editor/XT/Include/XTResizePoint.h
Normal file
@@ -0,0 +1,67 @@
|
||||
// XTResizePoint.h: interface for the CXTResizePoint class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//--------------------------------------------------------------------
|
||||
// Based on the resizable classes created by Torben B. Haagh. Used by permission.
|
||||
// http://www.codeguru.com/dialog/torbenResizeDialog.shtml
|
||||
//--------------------------------------------------------------------
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTRESIZEPOINT_H__)
|
||||
#define __XTRESIZEPOINT_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_RESIZEPOINT structure is a stand alone structure class. It defines
|
||||
// the x- and y-coordinates of a point.
|
||||
struct XT_RESIZEPOINT
|
||||
{
|
||||
XT_RESIZE x; // Specifies the x-coordinate of a point.
|
||||
XT_RESIZE y; // Specifies the y-coordinate of a point.
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTResizePoint is an XT_RESIZEPOINT structure derived class. The
|
||||
// CXTResizePoint class is similar to the XT_RESIZEPOINT structure.
|
||||
// It also includes member functions to manipulate CXTResizePoint and
|
||||
// XT_RESIZEPOINT structures. A CXTResizePoint object can be used wherever
|
||||
// an XT_RESIZEPOINT structure is used.
|
||||
class _XT_EXT_CLASS CXTResizePoint : public XT_RESIZEPOINT
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTResizePoint object.
|
||||
CXTResizePoint();
|
||||
|
||||
// Input: cx - Specifies the x-coordinate of a point.
|
||||
// cy - Specifies the y-coordinate of a point.
|
||||
// Summary: Constructs a CXTResizePoint object.
|
||||
CXTResizePoint(XT_RESIZE cx,XT_RESIZE cy);
|
||||
};
|
||||
//:Associate with "CXTResize"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define SZ_TOP_LEFT CXTResizePoint( 0, 0) // Specifies a top left position.
|
||||
#define SZ_TOP_CENTER CXTResizePoint(.5, 0) // Specifies a top center position.
|
||||
#define SZ_TOP_RIGHT CXTResizePoint( 1, 0) // Specifies a top right position.
|
||||
#define SZ_MIDDLE_LEFT CXTResizePoint( 0,.5) // Specifies a middle left position.
|
||||
#define SZ_MIDDLE_CENTER CXTResizePoint(.5,.5) // Specifies a middle center position.
|
||||
#define SZ_MIDDLE_RIGHT CXTResizePoint( 1,.5) // Specifies a middle right position.
|
||||
#define SZ_BOTTOM_LEFT CXTResizePoint( 0, 1) // Specifies a bottom left position.
|
||||
#define SZ_BOTTOM_CENTER CXTResizePoint(.5, 1) // Specifies a bottom center position.
|
||||
#define SZ_BOTTOM_RIGHT CXTResizePoint( 1, 1) // Specifies a bottom right position.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // !defined(__XTRESIZEPOINT_H__)
|
||||
69
Editor/XT/Include/XTResizePropertyPage.h
Normal file
69
Editor/XT/Include/XTResizePropertyPage.h
Normal file
@@ -0,0 +1,69 @@
|
||||
// XTResizePropertyPage.h: interface for the CXTResizePropertyPage class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//--------------------------------------------------------------------
|
||||
// Based on the resizable classes created by Torben B. Haagh. Used by permission.
|
||||
// http://www.codeguru.com/dialog/torbenResizeDialog.shtml
|
||||
//--------------------------------------------------------------------
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTRESIZEPROPERTYPAGE_H__)
|
||||
#define __XTRESIZEPROPERTYPAGE_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTResizePropertyPage is a multiple inheritance class derived from
|
||||
// CPropertyPage and CXTResize. CXTResizePropertyPage is used to create
|
||||
// a resizable CPropertyPage type object that allows its dialog items to
|
||||
// be resized or moved dynamically.
|
||||
class _XT_EXT_CLASS CXTResizePropertyPage : public CPropertyPage, public CXTResize
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTResizePropertyPage)
|
||||
|
||||
public:
|
||||
|
||||
// Input: nTemplate - ID of the template used for this page.
|
||||
// nCaption - ID of the name to be placed in the tab for this page. If 0, the name
|
||||
// will be taken from the dialog template for this page.
|
||||
// nFlags - Flags that are to be passed to CXTResize that specify the attributes
|
||||
// of the resizing property page. They can be one or more of the following,
|
||||
// and can be combined using the or (|) operator:
|
||||
// [ul]
|
||||
// [li]<b>SZ_NOSIZEICON</b> Do not add size icon.[/li]
|
||||
// [li]<b>SZ_NOHORISONTAL</b> No horizontal resizing.[/li]
|
||||
// [li]<b>SZ_NOVERTICAL</b> No vertical resizing.[/li]
|
||||
// [li]<b>SZ_NOMINSIZE</b> Do not require a minimum size.[/li]
|
||||
// [li]<b>SZ_NOCLIPCHILDREN</b> Do not set clip children style.[/li]
|
||||
// [li]<b>SZ_NOTRANSPARENTGROUP</b> Do not set transparent style
|
||||
// for group boxes.[/li]
|
||||
// [/ul]
|
||||
// Summary: Constructs a CXTResizePropertyPage object.
|
||||
CXTResizePropertyPage(const UINT nTemplate = 0,const UINT nCaption = 0,const UINT nFlags = 0);
|
||||
|
||||
DWORD m_nDialogID; // ID of the template used for this page.
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTResizePropertyPage)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg void OnGetMinMaxInfo(MINMAXINFO *lpMMI);
|
||||
afx_msg void OnDestroy();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // !defined(__XTRESIZEPROPERTYPAGE_H__)
|
||||
110
Editor/XT/Include/XTResizePropertySheet.h
Normal file
110
Editor/XT/Include/XTResizePropertySheet.h
Normal file
@@ -0,0 +1,110 @@
|
||||
// XTResizePropertySheet.h: interface for the CXTResizePropertySheet class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//--------------------------------------------------------------------
|
||||
// Based on the resizable classes created by Torben B. Haagh. Used by permission.
|
||||
// http://www.codeguru.com/dialog/torbenResizeDialog.shtml
|
||||
//--------------------------------------------------------------------
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTRESIZEPROPERTYSHEET_H__)
|
||||
#define __XTRESIZEPROPERTYSHEET_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTResizePropertySheet is a multiple inheritance class derived from
|
||||
// CPropertySheet and CXTResize. CXTResizePropertySheet is used to create
|
||||
// a resizable CPropertySheet type object that allows its dialog items
|
||||
// to be resized or moved dynamically.
|
||||
class _XT_EXT_CLASS CXTResizePropertySheet : public CPropertySheet, public CXTResize
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTResizePropertySheet);
|
||||
|
||||
public:
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: nCaption - ID of the caption to be used for the property sheet.
|
||||
// pParent - Points to the parent window of the property sheet. If NULL, the parent
|
||||
// window will be the main window of the application.
|
||||
// nSelectPage - The index of the page that will initially be on top. Default is the
|
||||
// first page added to the sheet.
|
||||
// nFlags - Flags that are to be passed to CXTResize that specify the attributes
|
||||
// of the resizing property page. They can be one or more of the following,
|
||||
// and can be combined using the or (|) operator:
|
||||
// [ul]
|
||||
// [li]<b>SZ_NOSIZEICON</b> Do not add size icon.[/li]
|
||||
// [li]<b>SZ_NOHORISONTAL</b> No horizontal resizing.[/li]
|
||||
// [li]<b>SZ_NOVERTICAL</b> No vertical resizing.[/li]
|
||||
// [li]<b>SZ_NOMINSIZE</b> Do not require a minimum size.[/li]
|
||||
// [li]<b>SZ_NOCLIPCHILDREN</b> Do not set clip children style.[/li]
|
||||
// [li]<b>SZ_NOTRANSPARENTGROUP</b> Do not set transparent style
|
||||
// for group boxes.[/li]
|
||||
// [/ul]
|
||||
// Summary: Constructs a CXTResizePropertySheet object.
|
||||
CXTResizePropertySheet(const UINT nCaption = 0,CWnd* pParent = 0,const UINT nSelectPage = 0,const UINT nFlags = 0);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: pszCaption - Points to a string containing the caption to be used for the property
|
||||
// sheet. It <b>cannot</b> be NULL.
|
||||
// pParent - Points to the parent window of the property sheet. If NULL, the parent
|
||||
// window will be the main window of the application.
|
||||
// nSelectPage - The index of the page that will initially be on top. The default is the
|
||||
// first page added to the sheet.
|
||||
// nFlags - Flags that are to be passed to CXTResize that specify the attributes
|
||||
// of the resizing property page. They can be one or more of the following,
|
||||
// and can be combined using the or (|) operator:
|
||||
// [ul]
|
||||
// [li]<b>SZ_NOSIZEICON</b> Do not add size icon.[/li]
|
||||
// [li]<b>SZ_NOHORISONTAL</b> No horizontal resizing.[/li]
|
||||
// [li]<b>SZ_NOVERTICAL</b> No vertical resizing.[/li]
|
||||
// [li]<b>SZ_NOMINSIZE</b> Do not require a minimum size.[/li]
|
||||
// [li]<b>SZ_NOCLIPCHILDREN</b> Do not set clip children style.[/li]
|
||||
// [li]<b>SZ_NOTRANSPARENTGROUP</b> Do not set transparent style
|
||||
// for group boxes.[/li]
|
||||
// [/ul]
|
||||
// Summary: Constructs a CXTResizePropertySheet object.
|
||||
CXTResizePropertySheet(LPCTSTR pszCaption,CWnd* pParent = 0,const UINT nSelectPage = 0,const UINT nFlags = 0);
|
||||
|
||||
CXTNoFlickerWnd <CTabCtrl> m_tabCtrl;
|
||||
|
||||
protected:
|
||||
|
||||
// Returns: TRUE if the property sheet is a wizard, otherwise returns FALSE.
|
||||
// Summary: This member function determines if the property sheet is in wizard mode.
|
||||
BOOL IsWizard();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTResizePropertySheet)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg void OnGetMinMaxInfo(MINMAXINFO *lpMMI);
|
||||
afx_msg void OnDestroy();
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg BOOL OnPageChanging(NMHDR* pNotifyStruct, LRESULT* pResult);
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
friend CXTResizePropertyPage;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE BOOL CXTResizePropertySheet::IsWizard() {
|
||||
return (m_psh.dwFlags & PSH_WIZARD);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // !defined(__XTRESIZEPROPERTYSHEET_H__)
|
||||
172
Editor/XT/Include/XTResizeRect.h
Normal file
172
Editor/XT/Include/XTResizeRect.h
Normal file
@@ -0,0 +1,172 @@
|
||||
// XTResizeRect.h: interface for the CXTResizeRect class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//--------------------------------------------------------------------
|
||||
// Based on the resizable classes created by Torben B. Haagh. Used by permission.
|
||||
// http://www.codeguru.com/dialog/torbenResizeDialog.shtml
|
||||
//--------------------------------------------------------------------
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTRESIZERECT_H__)
|
||||
#define __XTRESIZERECT_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: Float data type used by resizing windows.
|
||||
typedef float XT_RESIZE;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_RESIZERECT structure is a stand alone structure class. It defines
|
||||
// the coordinates of the upper-left and lower-right corners of a rectangle.
|
||||
struct XT_RESIZERECT
|
||||
{
|
||||
XT_RESIZE left; // Specifies the x-coordinate of the upper-left corner of a rectangle.
|
||||
XT_RESIZE top; // Specifies the y-coordinate of the upper-left corner of a rectangle.
|
||||
XT_RESIZE right; // Specifies the x-coordinate of the lower-right corner of a rectangle.
|
||||
XT_RESIZE bottom; // Specifies the y-coordinate of the lower-right corner of a rectangle.
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTResizeRect is an XT_RESIZERECT structure derived class. The
|
||||
// CXTResizeRect class is similar to an XT_RESIZERECT structure. CXTResizeRect
|
||||
// also includes member functions to manipulate CXTResizeRect objects and
|
||||
// XT_RESIZERECT structures.
|
||||
class _XT_EXT_CLASS CXTResizeRect: public XT_RESIZERECT
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTResizeRect object.
|
||||
CXTResizeRect();
|
||||
|
||||
// Input: rc - Refers to the RECT structure with the coordinates for CXTResizeRect.
|
||||
// Summary: Constructs a CXTResizeRect object.
|
||||
CXTResizeRect(const RECT& rc);
|
||||
|
||||
// Input: rrc - Refers to the XT_RESIZERECT structure with the coordinates for
|
||||
// CXTResizeRect.
|
||||
// Summary: Constructs a CXTResizeRect object.
|
||||
CXTResizeRect(const XT_RESIZERECT& rrc);
|
||||
|
||||
// Input: l - Specifies the left position of CXTResizeRect.
|
||||
// t - Specifies the top of CXTResizeRect.
|
||||
// r - Specifies the right position of CXTResizeRect.
|
||||
// b - Specifies the bottom of CXTResizeRect.
|
||||
// Summary: Constructs a CXTResizeRect object.
|
||||
CXTResizeRect(XT_RESIZE l,XT_RESIZE t,XT_RESIZE r,XT_RESIZE b);
|
||||
|
||||
// Input: rc - Refers to a source rectangle. It can be a RECT or CRect.
|
||||
// Returns: A reference to a CXTResizeRect object.
|
||||
// Summary: This operator copies the dimensions of a rectangle to CXTResizeRect.
|
||||
CXTResizeRect& operator = (const RECT& rc);
|
||||
|
||||
// Input: rrc - Refers to a source rectangle. It can be a XT_RESIZERECT or CXTResizeRect.
|
||||
// Returns: A reference to a CXTResizeRect object.
|
||||
// Summary: This operator copies the dimensions of a rectangle to CXTResizeRect.
|
||||
CXTResizeRect& operator = (const XT_RESIZERECT& rrc);
|
||||
|
||||
// Input: rrc - Points to an XT_RESIZERECT structure or a CXTResizeRect object that
|
||||
// contains the number of units to inflate each side of CXTResizeRect.
|
||||
// Returns: A reference to a CXTResizeRect object.
|
||||
// Summary: This operator adds the specified offsets to CXTResizeRect or inflates
|
||||
// CXTResizeRect.
|
||||
CXTResizeRect& operator += (const XT_RESIZERECT& rrc);
|
||||
|
||||
// Input: rrc - Points to an XT_RESIZERECT structure or a CXTResizeRect object that
|
||||
// contains the number of units to inflate each side of the return value.
|
||||
// Returns: The resulting CXTResizeRect object.
|
||||
// Summary: This operator adds the given offsets to CRect or inflates CRect.
|
||||
CXTResizeRect operator + (const XT_RESIZERECT& rrc);
|
||||
|
||||
// Input: rrc - Contains an XT_RESIZERECT or a CXTResizeRect.
|
||||
// Returns: A CXTResizeRect that is the intersection of CXTResizeRect and 'rrc'. The
|
||||
// intersection is the largest rectangle that is contained in both rectangles.
|
||||
// Summary: This operator creates the intersection of CXTResizeRect and a rectangle,
|
||||
// and returns the resulting CXTResizeRect.
|
||||
CXTResizeRect operator & (const XT_RESIZERECT& rrc);
|
||||
|
||||
// Input: rrc - Refers to a source rectangle. It can be an XT_RESIZERECT or a CXTResizeRect.
|
||||
// Returns: true if equal, otherwise returns false.
|
||||
// Summary: This operator determines whether CXTResizeRect is equal to a rectangle.
|
||||
bool operator == (const XT_RESIZERECT& rrc);
|
||||
|
||||
// Input: rrc - Refers to a source rectangle. It can be an XT_RESIZERECT or a CXTResizeRect.
|
||||
// Returns: false if equal, otherwise returns true.
|
||||
// Summary: This operator determines whether CXTResizeRect is not equal to a rectangle.
|
||||
bool operator != (const XT_RESIZERECT& rrc);
|
||||
|
||||
// Summary: This operator converts a CXTResizeRect to a CRect. When you use this
|
||||
// function, you do not need the address-of (&) operator. This operator
|
||||
// will be automatically used when you pass a CXTResizeRect object to
|
||||
// a function that expects a CRect.
|
||||
operator CRect();
|
||||
|
||||
// Returns: true if normalized, otherwise returns false.
|
||||
// Summary: This member function determines if CXTResizeRect is normalized.
|
||||
bool IsNormalized();
|
||||
|
||||
// Returns: The width of a CXTResizeRect.
|
||||
// Summary: This member function calculates the width of a CXTResizeRect by subtracting
|
||||
// the left value from the right value. The resulting value can be negative.
|
||||
XT_RESIZE Width();
|
||||
|
||||
// Returns: The height of a CXTResizeRect.
|
||||
// Summary: This member function calculates the height of a CXTResizeRect by subtracting
|
||||
// the top value from the bottom value. The resulting value can be negative.
|
||||
XT_RESIZE Height();
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE CXTResizeRect::CXTResizeRect(const RECT& rc) {
|
||||
(operator =)(rc);
|
||||
}
|
||||
AFX_INLINE CXTResizeRect::CXTResizeRect(const XT_RESIZERECT& rrc) {
|
||||
(operator =)(rrc);
|
||||
}
|
||||
AFX_INLINE CXTResizeRect CXTResizeRect::operator + (const XT_RESIZERECT& rrc) {
|
||||
return CXTResizeRect(left + rrc.left, top + rrc.top, right + rrc.right, bottom += rrc.bottom);
|
||||
}
|
||||
AFX_INLINE bool CXTResizeRect::IsNormalized() {
|
||||
return ((left <= right) && (top <= bottom));
|
||||
}
|
||||
AFX_INLINE bool CXTResizeRect::operator == (const XT_RESIZERECT& rrc) {
|
||||
return left==rrc.left && top==rrc.top && right==rrc.right && bottom==rrc.bottom;
|
||||
}
|
||||
AFX_INLINE bool CXTResizeRect::operator != (const XT_RESIZERECT& rrc) {
|
||||
return !operator==(rrc);
|
||||
}
|
||||
AFX_INLINE CXTResizeRect::operator CRect() {
|
||||
return CRect((int) left, (int) top, (int) right, (int) bottom);
|
||||
}
|
||||
AFX_INLINE XT_RESIZE CXTResizeRect::Width() {
|
||||
return right-left;
|
||||
}
|
||||
AFX_INLINE XT_RESIZE CXTResizeRect::Height() {
|
||||
return bottom-top;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//:Associate with "CXTResizeRect"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
#define SZ_RESIZE(x) CXTResizeRect(0,0,x,x) // Resize.
|
||||
#define SZ_REPOS(x) CXTResizeRect(x,x,x,x) // Reposition.
|
||||
#define SZ_HORRESIZE(x) CXTResizeRect(0,0,x,0) // Horizontal resize.
|
||||
#define SZ_HORREPOS(x) CXTResizeRect(x,0,x,0) // Horizontal reposition.
|
||||
#define SZ_VERRESIZE(x) CXTResizeRect(0,0,0,x) // Vertical resize.
|
||||
#define SZ_VERREPOS(x) CXTResizeRect(0,x,0,x) // Vertical reposition.
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // !defined(__XTRESIZERECT_H__)
|
||||
295
Editor/XT/Include/XTResource.h
Normal file
295
Editor/XT/Include/XTResource.h
Normal file
@@ -0,0 +1,295 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by XTResource.rc
|
||||
|
||||
#define XT_IDB_BTN_BAR 4500
|
||||
#define XT_IDB_SCROLL_ARW 4501
|
||||
#define XT_IDB_FONTTYPE 4502
|
||||
#define XT_IDB_BTN_OUT 4503
|
||||
#define XT_IDB_LIGHTBULB 4504
|
||||
#define XT_IDB_LISTEDIT 4505
|
||||
#define XT_IDB_BTN_PRINT 4506
|
||||
#define XT_IDB_CHECKLISTBOX 4507
|
||||
#define XT_IDI_XTREME 4508
|
||||
#define XT_IDC_DRAGCOPY 4509
|
||||
#define XT_IDC_DRAGMOVE 4510
|
||||
#define XT_IDC_HAND 4511
|
||||
#define XT_IDC_HSPLITBAR 4512
|
||||
#define XT_IDC_DRAGNONE 4513
|
||||
#define XT_IDC_VSPLITBAR 4514
|
||||
#define XT_IDC_HANDNONE 4515
|
||||
#define XT_IDD_WINDOWLIST 4516
|
||||
#define XT_IDD_CUSTPAGE4 4517
|
||||
#define XT_IDD_CUSTPAGE5 4518
|
||||
#define XT_IDM_POPUP 4519
|
||||
#define XT_IDR_TBAR_HDR 4520
|
||||
#define XT_IDR_TBAR_OUT 4521
|
||||
#define XT_IDR_TBAR_BLANK 4523
|
||||
#define XT_IDR_TBAR_HEXEDIT 4524
|
||||
#define XT_IDD_PREVIEW_TOOLBAR 4525
|
||||
#define XT_IDD_TIPOFTHEDAY 4526
|
||||
#define XT_IDD_CUSTPAGE1 4527
|
||||
#define XT_IDD_CUSTPAGE2 4528
|
||||
#define XT_IDD_CUSTPAGE3 4529
|
||||
#define XT_IDD_NEWTOOLBAR 4530
|
||||
#define XT_IDD_COLORSTANDARD 4531
|
||||
#define XT_IDD_COLORCUSTOM 4532
|
||||
#define XT_IDS_REG_KEY 4533
|
||||
#define XT_IDS_REG_WINPOS 4534
|
||||
#define XT_IDS_REG_BARID 4535
|
||||
#define XT_IDS_REG_SETTINGS 4536
|
||||
#define XT_IDS_REG_BARPOS 4537
|
||||
#define XT_IDS_REG_WNDPOS 4538
|
||||
#define XT_IDS_REG_RECENTLIST 4539
|
||||
#define XT_IDS_REG_ITEMID 4540
|
||||
#define XT_IDS_REG_CBARID 4541
|
||||
#define XT_IDS_REG_COLINFO 4542
|
||||
#define XT_IDS_NAME 4543
|
||||
#define XT_IDS_SIZE 4544
|
||||
#define XT_IDS_CONTRACT 4545
|
||||
#define XT_IDS_TYPE 4546
|
||||
#define XT_IDS_MODIFIED 4547
|
||||
#define XT_IDS_INVALID_VER 4548
|
||||
#define XT_IDS_COLOR_AUTO 4549
|
||||
#define XT_IDS_COLOR_CUST 4550
|
||||
#define XT_IDS_ENTRY 4552
|
||||
#define XT_IDS_SELDIR 4555
|
||||
#define XT_IDS_DOCKWND 4556
|
||||
#define XT_IDS_RES_ASSERT 4557
|
||||
#define XT_IDS_TOOLBAR 4558
|
||||
#define XT_IDS_ERROR_BLANK 4559
|
||||
#define XT_IDS_STATUSBAR 4560
|
||||
#define XT_IDS_ERROR_EXISTS 4561
|
||||
#define XT_IDS_ERROR_LIMIT 4562
|
||||
#define XT_IDS_CUSTOM_BAR 4563
|
||||
#define XT_IDS_CUSTOM_CONFIRM 4564
|
||||
#define XT_IDS_DOT 4565
|
||||
#define XT_IDS_NOHELPTOPIC 4566
|
||||
#define XT_IDS_DEFEXT 4567
|
||||
#define XT_IDS_DEFFILT 4568
|
||||
#define XT_IDS_DEFTITLE 4569
|
||||
#define XT_IDS_CLICKKEEPOPEN 4570
|
||||
#define XT_IDS_SE_0 4571
|
||||
#define XT_IDS_SE_ERR_FNF 4572
|
||||
#define XT_IDS_SE_ERR_PNF 4573
|
||||
#define XT_IDS_SE_ERR_ACCESSDENIED 4574
|
||||
#define XT_IDS_SE_ERR_OOM 4575
|
||||
#define XT_IDS_SE_ERR_BAD_FORMAT 4576
|
||||
#define XT_IDS_SE_ERR_SHARE 4577
|
||||
#define XT_IDS_SE_ERR_ASSOCINCOMPLETE 4578
|
||||
#define XT_IDS_SE_ERR_DDETIMEOUT 4579
|
||||
#define XT_IDS_SE_ERR_DDEFAIL 4580
|
||||
#define XT_IDS_SE_ERR_DDEBUSY 4581
|
||||
#define XT_IDS_SE_ERR_NOASSOC 4582
|
||||
#define XT_IDS_SE_ERR_DLLNOTFOUND 4583
|
||||
#define XT_IDS_SE_ERR_UNKOWN 4584
|
||||
#define XT_IDS_CLOSE 4585
|
||||
#define XT_IDS_CLR_BLACK 4586
|
||||
#define XT_IDS_CLR_BROWN 4587
|
||||
#define XT_IDS_CLR_OLIVE_GREEN 4588
|
||||
#define XT_IDS_CLR_DARK_GREEN 4589
|
||||
#define XT_IDS_CLR_DARK_TEAL 4590
|
||||
#define XT_IDS_CLR_DARK_BLUE 4591
|
||||
#define XT_IDS_CLR_INDIGO 4592
|
||||
#define XT_IDS_CLR_GRAY80 4593
|
||||
#define XT_IDS_CLR_DARK_RED 4594
|
||||
#define XT_IDS_CLR_ORANGE 4595
|
||||
#define XT_IDS_CLR_DARK_YELLOW 4596
|
||||
#define XT_IDS_CLR_GREEN 4597
|
||||
#define XT_IDS_CLR_TEAL 4598
|
||||
#define XT_IDS_CLR_BLUE 4599
|
||||
#define XT_IDS_CLR_BLUEGRAY 4600
|
||||
#define XT_IDS_CLR_GRAY50 4601
|
||||
#define XT_IDS_CLR_RED 4602
|
||||
#define XT_IDS_CLR_LIGHTORANGE 4603
|
||||
#define XT_IDS_CLR_LIME 4604
|
||||
#define XT_IDS_CLR_SEA_GREEN 4605
|
||||
#define XT_IDS_CLR_AQUA 4606
|
||||
#define XT_IDS_CLR_LIGHT_BLUE 4607
|
||||
#define XT_IDS_CLR_VIOLET 4608
|
||||
#define XT_IDS_CLR_GRAY40 4609
|
||||
#define XT_IDS_CLR_PINK 4610
|
||||
#define XT_IDS_CLR_GOLD 4611
|
||||
#define XT_IDS_CLR_YELLOW 4612
|
||||
#define XT_IDS_CLR_BRIGHT_GREEN 4613
|
||||
#define XT_IDS_CLR_TURQUOISE 4614
|
||||
#define XT_IDS_CLR_SKY_BLUE 4615
|
||||
#define XT_IDS_CLR_PLUM 4616
|
||||
#define XT_IDS_CLR_GRAY25 4617
|
||||
#define XT_IDS_CLR_ROSE 4618
|
||||
#define XT_IDS_CLR_TAN 4619
|
||||
#define XT_IDS_CLR_LIGHT_YELLOW 4620
|
||||
#define XT_IDS_CLR_LIGHT_GREEN 4621
|
||||
#define XT_IDS_CLR_LIGHT_TURQUOISE 4622
|
||||
#define XT_IDS_CLR_PALE_BLUE 4623
|
||||
#define XT_IDS_CLR_LAVENDER 4624
|
||||
#define XT_IDS_CLR_WHITE 4625
|
||||
#define XT_IDS_CLR_GRAY 4626
|
||||
#define XT_IDS_CLR_MAROON 4627
|
||||
#define XT_IDS_CLR_OLIVE 4628
|
||||
#define XT_IDS_CLR_NAVY 4629
|
||||
#define XT_IDS_CLR_PURPLE 4630
|
||||
#define XT_IDS_CLR_SILVER 4631
|
||||
#define XT_IDS_CLR_FUCHSIA 4632
|
||||
#define XT_IDS_CLR_NOFILL 4633
|
||||
#define XT_IDS_CLR_NOFILL_TIP 4634
|
||||
#define XT_IDS_AUTOMATIC 4635
|
||||
#define XT_IDS_AUTOMATIC_TIP 4636
|
||||
#define XT_IDS_MORE_COLORS 4637
|
||||
#define XT_IDS_MORE_COLORS_TIP 4638
|
||||
#define XT_IDS_STD_COLORS 4639
|
||||
#define XT_IDS_TIPTEXT 4640
|
||||
#define XT_IDS_DIDYOUKNOW 4641
|
||||
#define XT_IDS_FILE_ABSENT 4642
|
||||
#define XT_IDS_FILE_CORRUPT 4643
|
||||
#define XT_IDS_MENUBAR 4644
|
||||
#define XT_IDS_CONTROLBAR 4645
|
||||
#define XT_IDS_CUSTOMIZE 4646
|
||||
#define XT_IDS_COLOR_CAPTION 4647
|
||||
#define XT_IDS_NEW 4648
|
||||
#define XT_IDS_CURRENT 4649
|
||||
#define XT_IDS_DIRECTORIES 4650
|
||||
#define XT_IDS_FILES 4651
|
||||
#define XT_IDS_RESTORE 4652
|
||||
#define XT_IDS_WINDOWS 4653
|
||||
#define XT_IDS_MANAGEKEYBRD 4654
|
||||
#define XT_IDS_COMMAND 4655
|
||||
#define XT_IDS_KEYS 4656
|
||||
#define XT_IDB_BTN_FRAME 4656
|
||||
#define XT_IDS_DESCRIPTION 4657
|
||||
#define XT_IDS_ALLCOMMANDS 4658
|
||||
#define XT_IDS_REASSIGN 4659
|
||||
#define XT_IDS_WIND_MINIMIZE 4660
|
||||
#define XT_IDS_WIND_RESTORE 4661
|
||||
#define XT_IDS_WIND_CLOSE 4662
|
||||
#define XT_IDS_TOOLBAR_OPTS 4663
|
||||
#define XT_IDC_LBOX_TOOLSLIST 4664
|
||||
#define XT_IDS_TOOLS 4664
|
||||
#define XT_IDC_EDIT_TOOLSCMD 4665
|
||||
#define XT_IDS_PATH_INVALID 4665
|
||||
#define XT_IDC_EDIT_TOOLSARG 4666
|
||||
#define XT_IDS_AREYOUSURE 4666
|
||||
#define XT_IDC_EDIT_TOOLSDIR 4667
|
||||
#define XT_IDS_AREYOUSURE_2 4667
|
||||
#define XT_IDC_TXT_TOOLSCMD 4668
|
||||
#define XT_IDS_BROWSE 4668
|
||||
#define XT_IDC_TXT_TOOLSARG 4669
|
||||
#define XT_IDS_BROWSE_FILTER 4669
|
||||
#define XT_IDC_TXT_TOOLSDIR 4670
|
||||
#define XT_IDS_MENU_CONTENTS 4670
|
||||
#define XT_IDB_CHECKLISTBOX_3D 4672
|
||||
#define XT_IDS_ANIM_SYSDEF 4672
|
||||
#define XT_IDS_ANIM_RANDOM 4673
|
||||
#define XT_IDS_ANIM_UNFOLD 4674
|
||||
#define XT_IDS_ANIM_SLIDE 4675
|
||||
#define XT_IDS_ANIM_FADE 4676
|
||||
#define XT_IDR_PREVIEW_TOOLBAR 4677
|
||||
#define XT_IDC_GROUP_EDIT 5501
|
||||
#define XT_IDC_EDIT_TOOLBAR 5502
|
||||
#define XT_IDC_LBOX_EDIT 5503
|
||||
#define XT_IDC_LBOX_CHECK 5504
|
||||
#define XT_IDC_LBOX_CATEGORIES 5505
|
||||
#define XT_IDC_LBOX_COMMANDS 5506
|
||||
#define XT_IDC_TXT_TOOLBARS 5507
|
||||
#define XT_IDC_TXT_CATEGORIES 5508
|
||||
#define XT_IDC_TXT_COMMANDS 5509
|
||||
#define XT_IDC_TXT_SELECTED 5510
|
||||
#define XT_IDC_BTN_CLOSE 5511
|
||||
#define XT_IDC_BTN_EXPAND 5512
|
||||
#define XT_IDC_BTN_LEFT 5513
|
||||
#define XT_IDC_BTN_RIGHT 5514
|
||||
#define XT_IDC_BTN_HOME 5515
|
||||
#define XT_IDC_BTN_END 5516
|
||||
#define XT_IDC_BTN_NEW 5517
|
||||
#define XT_IDC_BTN_DELETE 5518
|
||||
#define XT_IDC_BTN_UP 5519
|
||||
#define XT_IDC_BTN_DOWN 5520
|
||||
#define XT_IDC_BTN_BROWSE 5521
|
||||
#define XT_IDC_BTN_DAYTIP_BORDER 5522
|
||||
#define XT_IDC_CHK_DAYTIP_SHOW 5523
|
||||
#define XT_IDC_BTN_DAYTIP_NEXT 5524
|
||||
#define XT_IDC_BTN_RENAME 5525
|
||||
#define XT_IDC_BTN_RESET 5526
|
||||
#define XT_IDC_BTN_DESCRIPTION 5527
|
||||
#define XT_IDC_CHK_STANDARD 5528
|
||||
#define XT_IDC_CHK_MENUSHADOWS 5528
|
||||
#define XT_IDC_CHK_RECENTMENU 5529
|
||||
#define XT_IDC_CHK_SHOWFULL 5530
|
||||
#define XT_IDC_EDIT_RED 5531
|
||||
#define XT_IDC_CHK_SCREENTIPS 5531
|
||||
#define XT_IDC_TXT_COLORS 5532
|
||||
#define XT_IDC_CHK_SHOWSHORTCUTKEYS 5532
|
||||
#define XT_IDC_EDIT_GREEN 5533
|
||||
#define XT_IDC_SPIN_HUE 5534
|
||||
#define XT_IDC_EDIT_LUM 5535
|
||||
#define XT_IDC_EDIT_SAT 5536
|
||||
#define XT_IDC_EDIT_HUE 5537
|
||||
#define XT_IDC_SPIN_SAT 5538
|
||||
#define XT_IDC_SPIN_LUM 5539
|
||||
#define XT_IDC_EDIT_BLUE 5540
|
||||
#define XT_IDC_SPIN_RED 5541
|
||||
#define XT_IDC_SPIN_GREEN 5542
|
||||
#define XT_IDC_SPIN_BLUE 5543
|
||||
#define XT_IDC_TXT_HUE 5544
|
||||
#define XT_IDC_TXT_SAT 5545
|
||||
#define XT_IDC_TXT_LUM 5546
|
||||
#define XT_IDC_TXT_RED 5547
|
||||
#define XT_IDC_TXT_GREEN 5548
|
||||
#define XT_IDC_TXT_BLUE 5549
|
||||
#define XT_IDC_CLR_WND 5550
|
||||
#define XT_IDC_CLR_LUM 5551
|
||||
#define XT_IDC_CLR_HEX 5552
|
||||
#define XT_IDC_LBOX_WINDOWS 5553
|
||||
#define XT_IDC_BTN_CASCADE 5554
|
||||
#define XT_IDC_BTN_MINIMIZE 5555
|
||||
#define XT_IDC_BTN_CLOSEWINDOWS 5556
|
||||
#define XT_IDC_BTN_SAVE 5557
|
||||
#define XT_IDC_BTN_TILEHORZ 5558
|
||||
#define XT_IDC_BTN_TILEVERT 5559
|
||||
#define XT_IDC_BTN_ACTIVATE 5560
|
||||
#define XT_IDC_LBOX_ACCEL_COMMANDS 5561
|
||||
#define XT_IDC_LBOX_KEYS 5562
|
||||
#define XT_IDC_EDIT_SHORTCUTKEY 5564
|
||||
#define XT_IDC_COMBO_CATEGORY 5565
|
||||
#define XT_IDC_BTN_ASSIGN 5566
|
||||
#define XT_IDC_BTN_ACCEL_RESET 5567
|
||||
#define XT_IDC_BTN_REMOVE 5568
|
||||
#define XT_IDC_TXT_NEWKEY 5570
|
||||
#define XT_IDC_TXT_ASSIGNMENTS 5571
|
||||
#define XT_IDC_TXT_FRAMETITLE 5572
|
||||
#define XT_IDC_TXT_DESC_OVERVIEW 5573
|
||||
#define XT_IDC_TXT_DESC_TITLE 5574
|
||||
#define XT_IDC_CHK_VISUALIZE 5575
|
||||
#define XT_IDC_TXT_PERSONALIZED 5576
|
||||
#define XT_IDC_TXT_OTHER 5577
|
||||
#define XT_IDC_SEP_PERSONALIZED 5578
|
||||
#define XT_IDC_SEP_OTHER 5579
|
||||
#define XT_IDC_COMBO_ANIMATION 5582
|
||||
#define XT_IDC_SORTASC 53773
|
||||
#define XT_IDC_SORTDSC 53774
|
||||
#define XT_IDC_ALIGNLEFT 53775
|
||||
#define XT_IDC_ALIGNCENTER 53776
|
||||
#define XT_IDC_ALIGNRIGHT 53777
|
||||
#define XT_IDC_LARGEICON 53778
|
||||
#define XT_IDC_SMALLICON 53779
|
||||
#define XT_IDC_REMOVEITEM 53780
|
||||
#define XT_IDC_RENAMEITEM 53781
|
||||
#define XT_IDC_CUSTOMIZE 53782
|
||||
#define XT_IDC_CHEVRON 53783
|
||||
#define XT_IDC_REMOVEGROUP 53784
|
||||
#define XT_IDC_RENAMEGROUP 53785
|
||||
#define XT_IDC_BLANK 53786
|
||||
#define XT_IDC_SORT_CATEGORIZED 53787
|
||||
#define XT_IDC_SORT_ALPHABETIC 53788
|
||||
#define XT_IDC_TAB_CLOSE 53789
|
||||
|
||||
// Next default values for new objects
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 4673
|
||||
#define _APS_NEXT_COMMAND_VALUE 52790
|
||||
#define _APS_NEXT_CONTROL_VALUE 5583
|
||||
#define _APS_NEXT_SYMED_VALUE 4652
|
||||
#endif
|
||||
#endif
|
||||
783
Editor/XT/Include/XTResource.rc
Normal file
783
Editor/XT/Include/XTResource.rc
Normal file
@@ -0,0 +1,783 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "XTResource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Neutral resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Cursor
|
||||
//
|
||||
|
||||
XT_IDC_DRAGMOVE CURSOR DISCARDABLE "res\\dragmove.cur"
|
||||
XT_IDC_HAND CURSOR DISCARDABLE "res\\hand.cur"
|
||||
XT_IDC_HSPLITBAR CURSOR DISCARDABLE "res\\splith.cur"
|
||||
XT_IDC_DRAGNONE CURSOR DISCARDABLE "res\\dragnone.cur"
|
||||
XT_IDC_HANDNONE CURSOR DISCARDABLE "res\\handnone.cur"
|
||||
XT_IDC_VSPLITBAR CURSOR DISCARDABLE "res\\splitv.cur"
|
||||
XT_IDC_DRAGCOPY CURSOR DISCARDABLE "res\\dragcopy.cur"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Bitmap
|
||||
//
|
||||
|
||||
XT_IDB_BTN_BAR BITMAP DISCARDABLE "res\\btn_bar.bmp"
|
||||
XT_IDB_BTN_OUT BITMAP DISCARDABLE "res\\btn_out.bmp"
|
||||
XT_IDB_LIGHTBULB BITMAP FIXED IMPURE "res\\lightbulb.bmp"
|
||||
XT_IDB_LISTEDIT BITMAP DISCARDABLE "res\\btn_listedit.bmp"
|
||||
XT_IDB_FONTTYPE BITMAP DISCARDABLE "res\\font.bmp"
|
||||
XT_IDB_SCROLL_ARW BITMAP DISCARDABLE "res\\scroll.bmp"
|
||||
XT_IDB_BTN_PRINT BITMAP DISCARDABLE "res\\btn_print.bmp"
|
||||
XT_IDB_CHECKLISTBOX BITMAP FIXED IMPURE "res\\checklist.bmp"
|
||||
XT_IDB_BTN_FRAME BITMAP DISCARDABLE "res\\btn_frame.bmp"
|
||||
XT_IDB_CHECKLISTBOX_3D BITMAP FIXED IMPURE "res\\checklist_3d.bmp"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
XT_IDI_XTREME ICON DISCARDABLE "res\\xtreme.ico"
|
||||
#endif // Neutral resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Bitmap
|
||||
//
|
||||
|
||||
XT_IDR_TBAR_HDR BITMAP DISCARDABLE "res\\tbar_hdr.bmp"
|
||||
XT_IDR_TBAR_OUT BITMAP MOVEABLE PURE "res\\tbar_out.bmp"
|
||||
XT_IDR_TBAR_BLANK BITMAP DISCARDABLE "res\\tbar_blank.bmp"
|
||||
XT_IDR_TBAR_HEXEDIT BITMAP DISCARDABLE "res\\tbar_hex.bmp"
|
||||
XT_IDR_PREVIEW_TOOLBAR BITMAP DISCARDABLE "res\\tbar_preview.bmp"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Toolbar
|
||||
//
|
||||
|
||||
XT_IDR_TBAR_HDR TOOLBAR DISCARDABLE 16, 15
|
||||
BEGIN
|
||||
BUTTON XT_IDC_SORTASC
|
||||
BUTTON XT_IDC_SORTDSC
|
||||
SEPARATOR
|
||||
BUTTON XT_IDC_ALIGNLEFT
|
||||
BUTTON XT_IDC_ALIGNCENTER
|
||||
BUTTON XT_IDC_ALIGNRIGHT
|
||||
END
|
||||
|
||||
XT_IDR_TBAR_OUT TOOLBAR DISCARDABLE 16, 15
|
||||
BEGIN
|
||||
BUTTON XT_IDC_LARGEICON
|
||||
BUTTON XT_IDC_SMALLICON
|
||||
END
|
||||
|
||||
XT_IDR_TBAR_BLANK TOOLBAR DISCARDABLE 16, 15
|
||||
BEGIN
|
||||
BUTTON XT_IDC_BLANK
|
||||
END
|
||||
|
||||
XT_IDR_TBAR_HEXEDIT TOOLBAR DISCARDABLE 16, 15
|
||||
BEGIN
|
||||
BUTTON ID_EDIT_UNDO
|
||||
SEPARATOR
|
||||
BUTTON ID_EDIT_CUT
|
||||
BUTTON ID_EDIT_COPY
|
||||
BUTTON ID_EDIT_PASTE
|
||||
SEPARATOR
|
||||
BUTTON ID_EDIT_CLEAR
|
||||
END
|
||||
|
||||
XT_IDR_PREVIEW_TOOLBAR TOOLBAR DISCARDABLE 16, 15
|
||||
BEGIN
|
||||
BUTTON AFX_ID_PREVIEW_PRINT
|
||||
BUTTON AFX_ID_PREVIEW_NEXT
|
||||
BUTTON AFX_ID_PREVIEW_PREV
|
||||
BUTTON AFX_ID_PREVIEW_NUMPAGE
|
||||
BUTTON AFX_ID_PREVIEW_ZOOMIN
|
||||
BUTTON AFX_ID_PREVIEW_ZOOMOUT
|
||||
BUTTON AFX_ID_PREVIEW_CLOSE
|
||||
BUTTON XT_IDC_BLANK
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
XT_IDD_TIPOFTHEDAY DIALOGEX 0, 0, 279, 157
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Tip of the Day"
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "&Close",IDOK,221,136,50,14
|
||||
CONTROL "&Show tips at startup",XT_IDC_CHK_DAYTIP_SHOW,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,140,78,10
|
||||
PUSHBUTTON "&Next Tip",XT_IDC_BTN_DAYTIP_NEXT,162,136,50,14
|
||||
CONTROL "",XT_IDC_BTN_DAYTIP_BORDER,"Static",SS_GRAYFRAME | NOT
|
||||
WS_VISIBLE,8,7,263,123
|
||||
END
|
||||
|
||||
XT_IDD_NEWTOOLBAR DIALOG DISCARDABLE 0, 0, 186, 60
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "New Toolbar"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,73,39,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,129,39,50,14
|
||||
EDITTEXT XT_IDC_EDIT_TOOLBAR,7,18,172,14,ES_AUTOHSCROLL
|
||||
LTEXT "&Toolbar Name:",IDC_STATIC,7,7,48,8
|
||||
END
|
||||
|
||||
XT_IDD_CUSTPAGE1 DIALOG DISCARDABLE 0, 0, 230, 150
|
||||
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "Tool&bars"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Toolb&ars:",XT_IDC_TXT_TOOLBARS,4,5,30,8
|
||||
LISTBOX XT_IDC_LBOX_CHECK,4,15,150,131,LBS_SORT |
|
||||
LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "&New...",XT_IDC_BTN_NEW,158,15,70,14,BS_CENTER |
|
||||
BS_VCENTER
|
||||
PUSHBUTTON "Rename...",XT_IDC_BTN_RENAME,158,33,70,14,BS_CENTER |
|
||||
BS_VCENTER | WS_DISABLED
|
||||
PUSHBUTTON "Delete",XT_IDC_BTN_DELETE,158,51,70,14,BS_CENTER |
|
||||
BS_VCENTER | WS_DISABLED
|
||||
PUSHBUTTON "&Reset...",XT_IDC_BTN_RESET,158,69,70,14,BS_CENTER |
|
||||
BS_VCENTER
|
||||
END
|
||||
|
||||
XT_IDD_CUSTPAGE2 DIALOG DISCARDABLE 0, 0, 230, 150
|
||||
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "&Commands"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LISTBOX XT_IDC_LBOX_CATEGORIES,2,14,81,84,LBS_OWNERDRAWFIXED |
|
||||
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
LISTBOX XT_IDC_LBOX_COMMANDS,88,14,140,84,LBS_OWNERDRAWVARIABLE |
|
||||
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
LTEXT "Cate&gories:",XT_IDC_TXT_CATEGORIES,3,5,38,8
|
||||
LTEXT "Comman&ds:",XT_IDC_TXT_COMMANDS,89,5,38,8,WS_TABSTOP
|
||||
LTEXT "Selected Command:",XT_IDC_TXT_SELECTED,3,103,64,8
|
||||
PUSHBUTTON "Description",XT_IDC_BTN_DESCRIPTION,11,115,81,14,
|
||||
BS_CENTER | BS_VCENTER
|
||||
END
|
||||
|
||||
XT_IDD_CUSTPAGE5 DIALOG DISCARDABLE 0, 0, 230, 150
|
||||
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "&Options"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Personalized Menus and Toolbars ",
|
||||
XT_IDC_TXT_PERSONALIZED,7,5,110,8
|
||||
CONTROL "",XT_IDC_SEP_PERSONALIZED,"Static",SS_ETCHEDHORZ,122,9,
|
||||
101,1
|
||||
CONTROL "Menus have shadows.",XT_IDC_CHK_MENUSHADOWS,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,20,87,10
|
||||
CONTROL "Me&nus show recently used commands first.",
|
||||
XT_IDC_CHK_RECENTMENU,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,7,32,151,10
|
||||
CONTROL "Show f&ull menus after a short delay.",
|
||||
XT_IDC_CHK_SHOWFULL,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,25,44,127,10
|
||||
PUSHBUTTON "&Reset my usage data",XT_IDC_BTN_RESET,7,61,80,14,
|
||||
BS_CENTER | BS_VCENTER
|
||||
LTEXT "Other",XT_IDC_TXT_OTHER,7,81,20,8
|
||||
CONTROL "",XT_IDC_SEP_OTHER,"Static",SS_ETCHEDHORZ,30,85,193,1
|
||||
CONTROL "Show toolbar contents while dragging.",
|
||||
XT_IDC_CHK_VISUALIZE,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,7,95,136,10
|
||||
CONTROL "Show Screen&Tips on toolbars.",XT_IDC_CHK_SCREENTIPS,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,107,111,10
|
||||
CONTROL "Show s&hortcut keys in ScreenTips.",
|
||||
XT_IDC_CHK_SHOWSHORTCUTKEYS,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,25,119,125,10
|
||||
LTEXT "&Menu Animation",IDC_STATIC,7,134,52,8
|
||||
COMBOBOX XT_IDC_COMBO_ANIMATION,65,131,79,65,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
END
|
||||
|
||||
XT_IDD_PREVIEW_TOOLBAR DIALOG DISCARDABLE 0, 0, 61, 20
|
||||
STYLE WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "&Print...",AFX_ID_PREVIEW_PRINT,"Button",BS_OWNERDRAW |
|
||||
NOT WS_VISIBLE | WS_TABSTOP,3,3,55,14
|
||||
END
|
||||
|
||||
XT_IDD_COLORCUSTOM DIALOG DISCARDABLE 0, 0, 147, 161
|
||||
STYLE WS_CHILD | WS_DISABLED | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
|
||||
WS_CAPTION
|
||||
CAPTION "Custom"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "&Colors:",XT_IDC_TXT_COLORS,2,4,43,10
|
||||
CONTROL "",XT_IDC_CLR_WND,"Static",SS_BLACKFRAME | WS_TABSTOP,3,
|
||||
15,119,86
|
||||
CONTROL "",XT_IDC_CLR_LUM,"Static",SS_BLACKFRAME | WS_TABSTOP,
|
||||
126,15,20,86
|
||||
LTEXT "&Hue:",XT_IDC_TXT_HUE,7,108,18,8
|
||||
EDITTEXT XT_IDC_EDIT_HUE,25,106,33,13,ES_AUTOHSCROLL | ES_NUMBER
|
||||
CONTROL "Spin1",XT_IDC_SPIN_HUE,"msctls_updown32",
|
||||
UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS,49,105,
|
||||
10,14
|
||||
LTEXT "&Sat:",XT_IDC_TXT_SAT,7,125,18,8
|
||||
EDITTEXT XT_IDC_EDIT_SAT,25,122,33,13,ES_AUTOHSCROLL | ES_NUMBER
|
||||
CONTROL "Spin2",XT_IDC_SPIN_SAT,"msctls_updown32",
|
||||
UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS,49,122,
|
||||
10,14
|
||||
LTEXT "&Lum:",XT_IDC_TXT_LUM,7,140,18,8
|
||||
EDITTEXT XT_IDC_EDIT_LUM,25,138,33,13,ES_AUTOHSCROLL | ES_NUMBER
|
||||
CONTROL "Spin3",XT_IDC_SPIN_LUM,"msctls_updown32",
|
||||
UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS,49,137,
|
||||
10,14
|
||||
LTEXT "&Red:",XT_IDC_TXT_RED,65,108,23,8
|
||||
EDITTEXT XT_IDC_EDIT_RED,89,106,33,13,ES_AUTOHSCROLL | ES_NUMBER
|
||||
CONTROL "Spin1",XT_IDC_SPIN_RED,"msctls_updown32",
|
||||
UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS,113,105,
|
||||
11,14
|
||||
LTEXT "&Green:",XT_IDC_TXT_GREEN,65,125,23,8
|
||||
EDITTEXT XT_IDC_EDIT_GREEN,89,122,33,13,ES_AUTOHSCROLL |
|
||||
ES_NUMBER
|
||||
CONTROL "Spin2",XT_IDC_SPIN_GREEN,"msctls_updown32",
|
||||
UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS,113,122,
|
||||
11,14
|
||||
LTEXT "&Blue:",XT_IDC_TXT_BLUE,65,140,23,8
|
||||
EDITTEXT XT_IDC_EDIT_BLUE,89,138,33,13,ES_AUTOHSCROLL | ES_NUMBER
|
||||
CONTROL "Spin3",XT_IDC_SPIN_BLUE,"msctls_updown32",
|
||||
UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS,113,137,
|
||||
11,14
|
||||
END
|
||||
|
||||
XT_IDD_COLORSTANDARD DIALOG DISCARDABLE 0, 0, 147, 161
|
||||
STYLE WS_CHILD | WS_DISABLED | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
|
||||
WS_CAPTION
|
||||
CAPTION "Standard"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "&Colors:",XT_IDC_TXT_COLORS,2,4,43,10
|
||||
CONTROL "",XT_IDC_CLR_HEX,"Static",SS_BLACKFRAME | WS_TABSTOP,0,
|
||||
15,147,145
|
||||
END
|
||||
|
||||
XT_IDD_WINDOWLIST DIALOG DISCARDABLE 0, 0, 301, 164
|
||||
STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
|
||||
CAPTION "Windows"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Select &window:",IDC_STATIC,7,7,147,8
|
||||
LISTBOX XT_IDC_LBOX_WINDOWS,7,17,216,140,LBS_SORT |
|
||||
LBS_OWNERDRAWFIXED | LBS_HASSTRINGS |
|
||||
LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL |
|
||||
WS_HSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "&Activate",XT_IDC_BTN_ACTIVATE,233,7,62,14
|
||||
PUSHBUTTON "&OK",IDOK,233,24,62,14
|
||||
PUSHBUTTON "&Save",XT_IDC_BTN_SAVE,233,41,62,14
|
||||
PUSHBUTTON "&Close Window(s)",XT_IDC_BTN_CLOSEWINDOWS,233,58,62,14
|
||||
PUSHBUTTON "Casca&de",XT_IDC_BTN_CASCADE,233,75,62,14
|
||||
PUSHBUTTON "Tile &Horizontally",XT_IDC_BTN_TILEHORZ,233,92,62,14
|
||||
PUSHBUTTON "Tile &Vertically",XT_IDC_BTN_TILEVERT,233,109,62,14
|
||||
PUSHBUTTON "Minimi&ze",XT_IDC_BTN_MINIMIZE,233,126,62,14
|
||||
END
|
||||
|
||||
XT_IDD_CUSTPAGE3 DIALOGEX 0, 0, 230, 150
|
||||
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "Keyboard"
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||
BEGIN
|
||||
LTEXT "Commands:",XT_IDC_TXT_COMMANDS,2,28,38,8
|
||||
LISTBOX XT_IDC_LBOX_ACCEL_COMMANDS,2,39,93,74,LBS_OWNERDRAWFIXED |
|
||||
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
LTEXT "Current Assignments:",XT_IDC_TXT_ASSIGNMENTS,100,28,67,
|
||||
8
|
||||
LISTBOX XT_IDC_LBOX_KEYS,100,38,75,49,LBS_SORT |
|
||||
LBS_OWNERDRAWFIXED | LBS_HASSTRINGS |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Press new shortcut key:",XT_IDC_TXT_NEWKEY,100,91,76,8
|
||||
EDITTEXT XT_IDC_EDIT_SHORTCUTKEY,100,101,75,12,ES_AUTOHSCROLL
|
||||
PUSHBUTTON "&Assign",XT_IDC_BTN_ASSIGN,179,39,49,14
|
||||
PUSHBUTTON "&Remove",XT_IDC_BTN_REMOVE,179,56,49,14
|
||||
PUSHBUTTON "Re&set All",XT_IDC_BTN_ACCEL_RESET,179,73,49,14
|
||||
LTEXT "Description:",XT_IDC_TXT_DESC_TITLE,2,119,38,8
|
||||
LTEXT "",XT_IDC_TXT_DESC_OVERVIEW,2,129,173,19,0,
|
||||
WS_EX_STATICEDGE
|
||||
LTEXT "Category:",IDC_STATIC,2,5,31,8
|
||||
COMBOBOX XT_IDC_COMBO_CATEGORY,2,15,93,147,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "",XT_IDC_TXT_FRAMETITLE,100,15,128,12
|
||||
END
|
||||
|
||||
XT_IDD_CUSTPAGE4 DIALOG DISCARDABLE 0, 0, 230, 150
|
||||
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||
CAPTION "Tools"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LISTBOX XT_IDC_LBOX_TOOLSLIST,2,5,226,93,LBS_OWNERDRAWVARIABLE |
|
||||
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
RTEXT "&Command:",XT_IDC_TXT_TOOLSCMD,2,104,60,8
|
||||
RTEXT "&Arguments:",XT_IDC_TXT_TOOLSARG,2,119,60,8
|
||||
RTEXT "&Initial Directory:",XT_IDC_TXT_TOOLSDIR,2,134,60,8
|
||||
EDITTEXT XT_IDC_EDIT_TOOLSCMD,73,101,155,14,ES_AUTOHSCROLL
|
||||
EDITTEXT XT_IDC_EDIT_TOOLSARG,73,116,155,14,ES_AUTOHSCROLL
|
||||
EDITTEXT XT_IDC_EDIT_TOOLSDIR,73,131,155,14,ES_AUTOHSCROLL
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
XT_IDM_POPUP MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "RClickOutlookBar"
|
||||
BEGIN
|
||||
MENUITEM "S&mall Icons", XT_IDC_SMALLICON
|
||||
MENUITEM "Lar&ge Icons", XT_IDC_LARGEICON
|
||||
END
|
||||
POPUP "RClickHexEdit"
|
||||
BEGIN
|
||||
MENUITEM "&Undo", ID_EDIT_UNDO
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Cu&t", ID_EDIT_CUT
|
||||
MENUITEM "&Copy", ID_EDIT_COPY
|
||||
MENUITEM "&Paste", ID_EDIT_PASTE
|
||||
MENUITEM "&Delete", ID_EDIT_CLEAR
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Select &All", ID_EDIT_SELECT_ALL
|
||||
END
|
||||
POPUP "RClickHeader"
|
||||
BEGIN
|
||||
MENUITEM "Sort Ascending", XT_IDC_SORTASC
|
||||
MENUITEM "Sort Descending", XT_IDC_SORTDSC
|
||||
MENUITEM SEPARATOR
|
||||
POPUP "Alignment"
|
||||
BEGIN
|
||||
MENUITEM "Align Left", XT_IDC_ALIGNLEFT
|
||||
MENUITEM "Align Center", XT_IDC_ALIGNCENTER
|
||||
MENUITEM "Align Right", XT_IDC_ALIGNRIGHT
|
||||
END
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
XT_IDD_NEWTOOLBAR, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 179
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 53
|
||||
END
|
||||
|
||||
XT_IDD_CUSTPAGE1, DIALOG
|
||||
BEGIN
|
||||
TOPMARGIN, 5
|
||||
END
|
||||
|
||||
XT_IDD_CUSTPAGE2, DIALOG
|
||||
BEGIN
|
||||
RIGHTMARGIN, 228
|
||||
VERTGUIDE, 2
|
||||
TOPMARGIN, 5
|
||||
BOTTOMMARGIN, 142
|
||||
END
|
||||
|
||||
XT_IDD_CUSTPAGE5, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 223
|
||||
VERTGUIDE, 25
|
||||
TOPMARGIN, 5
|
||||
BOTTOMMARGIN, 142
|
||||
HORZGUIDE, 25
|
||||
HORZGUIDE, 37
|
||||
HORZGUIDE, 49
|
||||
HORZGUIDE, 100
|
||||
HORZGUIDE, 112
|
||||
HORZGUIDE, 124
|
||||
END
|
||||
|
||||
XT_IDD_PREVIEW_TOOLBAR, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 3
|
||||
RIGHTMARGIN, 58
|
||||
TOPMARGIN, 3
|
||||
BOTTOMMARGIN, 17
|
||||
END
|
||||
|
||||
XT_IDD_COLORCUSTOM, DIALOG
|
||||
BEGIN
|
||||
VERTGUIDE, 25
|
||||
VERTGUIDE, 58
|
||||
VERTGUIDE, 65
|
||||
VERTGUIDE, 89
|
||||
VERTGUIDE, 122
|
||||
VERTGUIDE, 127
|
||||
END
|
||||
|
||||
XT_IDD_WINDOWLIST, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 295
|
||||
VERTGUIDE, 223
|
||||
VERTGUIDE, 233
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 157
|
||||
HORZGUIDE, 82
|
||||
HORZGUIDE, 99
|
||||
HORZGUIDE, 116
|
||||
HORZGUIDE, 133
|
||||
END
|
||||
|
||||
XT_IDD_CUSTPAGE3, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 2
|
||||
RIGHTMARGIN, 228
|
||||
VERTGUIDE, 85
|
||||
VERTGUIDE, 95
|
||||
VERTGUIDE, 100
|
||||
VERTGUIDE, 175
|
||||
VERTGUIDE, 179
|
||||
TOPMARGIN, 5
|
||||
BOTTOMMARGIN, 148
|
||||
HORZGUIDE, 39
|
||||
HORZGUIDE, 87
|
||||
HORZGUIDE, 113
|
||||
END
|
||||
|
||||
XT_IDD_CUSTPAGE4, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 2
|
||||
RIGHTMARGIN, 228
|
||||
VERTGUIDE, 73
|
||||
TOPMARGIN, 5
|
||||
BOTTOMMARGIN, 145
|
||||
HORZGUIDE, 98
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"XTResource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
XT_IDC_BTN_CLOSE "Hide docked window"
|
||||
XT_IDC_BTN_EXPAND "Expand docked window"
|
||||
XT_IDC_BTN_NEW "New (Insert)"
|
||||
XT_IDC_BTN_DELETE "Delete (Delete)"
|
||||
XT_IDC_BTN_UP "Move Item Up (Alt+Up Arrow)"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
XT_IDS_REG_KEY "Software\\%s\\%s\\Settings"
|
||||
XT_IDS_REG_WINPOS "%u,%u,%d,%d,%d,%d,%d,%d,%d,%d"
|
||||
XT_IDS_REG_BARID "BarID"
|
||||
XT_IDS_REG_SETTINGS "Settings"
|
||||
XT_IDS_REG_BARPOS "Bar Position"
|
||||
XT_IDS_REG_WNDPOS "Window Position"
|
||||
XT_IDS_REG_RECENTLIST "Recent Item List"
|
||||
XT_IDS_REG_ITEMID "Item%d"
|
||||
XT_IDS_REG_CBARID "%s-Bar%d"
|
||||
XT_IDS_REG_COLINFO "Column Info"
|
||||
XT_IDS_NAME "Name"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
XT_IDS_SIZE "Size"
|
||||
XT_IDS_CONTRACT "Contract docked window"
|
||||
XT_IDS_TYPE "Type"
|
||||
XT_IDS_MODIFIED "Modified"
|
||||
XT_IDS_INVALID_VER "Warning: This program requires comctl32.dll version 4.71 or greater."
|
||||
XT_IDS_COLOR_AUTO "Automatic"
|
||||
XT_IDS_COLOR_CUST "Customize..."
|
||||
XT_IDS_SELDIR "Select Directory:"
|
||||
XT_IDS_DOCKWND "Dock Window"
|
||||
XT_IDS_RES_ASSERT "ERROR: Not all of the resources needed by Xtreme Toolkit have been correctly initialized.\n\nIf your project is a CDialog based application, or your CMainFrame class was not derived from CXTFrameWnd or CXTMDIFrameWnd you will need to call ""xtAfxData.InitResources();"" to initialize these resources and eliminate the assertion that follows this error.\n\nYou can place ""xtAfxData.InitResources();"" in the constructor of your CMainFrame or CDialog class."
|
||||
XT_IDS_TOOLBAR "Toolbar"
|
||||
XT_IDS_ERROR_BLANK "The toolbar name cannot be blank. Type a name."
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
XT_IDS_STATUSBAR "Status Bar"
|
||||
XT_IDS_ERROR_EXISTS "A toolbar named '%s' already exists. Type another name."
|
||||
XT_IDS_ERROR_LIMIT "Sorry you have reached your limit."
|
||||
XT_IDS_CUSTOM_BAR "Custom %d"
|
||||
XT_IDS_CUSTOM_CONFIRM "Are you sure you want to delete the '%s' toolbar?"
|
||||
XT_IDS_DOT "..."
|
||||
XT_IDS_NOHELPTOPIC "No help topic is associated with this item.\nCommand ID %d"
|
||||
XT_IDS_DEFEXT "*.*"
|
||||
XT_IDS_DEFFILT "All Files (*.*)|*.*||"
|
||||
XT_IDS_DEFTITLE "Choose Directory Name:"
|
||||
XT_IDS_CLICKKEEPOPEN "Click push pin to keep open"
|
||||
XT_IDS_SE_0 "The operating system is out of memory or resources."
|
||||
XT_IDS_SE_ERR_FNF "The specified file was not found."
|
||||
XT_IDS_SE_ERR_PNF "The specified path was not found."
|
||||
XT_IDS_SE_ERR_ACCESSDENIED
|
||||
"The operating system denied access to the specified file."
|
||||
XT_IDS_SE_ERR_OOM "There was not enough memory to complete the operation."
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
XT_IDS_SE_ERR_BAD_FORMAT
|
||||
"The .exe file is invalid (non-Win32<33> .exe or error in .exe image)."
|
||||
XT_IDS_SE_ERR_SHARE "A sharing violation occurred."
|
||||
XT_IDS_SE_ERR_ASSOCINCOMPLETE
|
||||
"The file name association is incomplete or invalid."
|
||||
XT_IDS_SE_ERR_DDETIMEOUT
|
||||
"The DDE transaction could not be completed because the request timed out."
|
||||
XT_IDS_SE_ERR_DDEFAIL "The DDE transaction failed."
|
||||
XT_IDS_SE_ERR_DDEBUSY "The DDE transaction could not be completed because other DDE transactions were being processed."
|
||||
XT_IDS_SE_ERR_NOASSOC "There is no application associated with the given file name extension."
|
||||
XT_IDS_SE_ERR_DLLNOTFOUND
|
||||
"The specified dynamic-link library was not found."
|
||||
XT_IDS_SE_ERR_UNKOWN "An unknown error number %d occured."
|
||||
XT_IDS_CLOSE "Close"
|
||||
XT_IDS_CLR_BLACK "Black"
|
||||
XT_IDS_CLR_BROWN "Brown"
|
||||
XT_IDS_CLR_OLIVE_GREEN "Olive Green"
|
||||
XT_IDS_CLR_DARK_GREEN "Dark Green"
|
||||
XT_IDS_CLR_DARK_TEAL "Dark Teal"
|
||||
XT_IDS_CLR_DARK_BLUE "Dark Blue"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
XT_IDC_SORTASC "Sorts the selected column in ascending order\nSort Ascending"
|
||||
XT_IDC_SORTDSC "Sorts the selected column in descending order\nSort Descending"
|
||||
XT_IDC_ALIGNLEFT "Left alligns the contents of the selected column\nAlign Left"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
XT_IDC_ALIGNCENTER "Center alligns the contents of the selected column\nAlign Center"
|
||||
XT_IDC_ALIGNRIGHT "Right alligns the contents of the selected column\nAlign Right"
|
||||
XT_IDC_LARGEICON "Display large icons\nLarge Icons"
|
||||
XT_IDC_SMALLICON "Display small icons\nSmall Icons"
|
||||
XT_IDC_REMOVEITEM "Remove from Outlook Bar"
|
||||
XT_IDC_RENAMEITEM "Rename Shortcut"
|
||||
XT_IDC_CUSTOMIZE "Allows for customization of the toolbar\nCustomize toolbar"
|
||||
XT_IDC_CHEVRON "Display full menus"
|
||||
XT_IDC_REMOVEGROUP "Remove Group"
|
||||
XT_IDC_RENAMEGROUP "Rename Group"
|
||||
XT_IDC_SORT_CATEGORIZED "Categorized\nCategorized"
|
||||
XT_IDC_SORT_ALPHABETIC "Alphabetic\nAlphabetic"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
XT_IDS_TIPTEXT "Tip Text"
|
||||
XT_IDS_DIDYOUKNOW "Did you know..."
|
||||
XT_IDS_FILE_ABSENT "Tips file does not exist in the prescribed directory"
|
||||
XT_IDS_FILE_CORRUPT "Trouble reading the tips file"
|
||||
XT_IDS_MENUBAR "Menu Bar"
|
||||
XT_IDS_CONTROLBAR "Control Bar"
|
||||
XT_IDS_CUSTOMIZE "Customize"
|
||||
XT_IDS_COLOR_CAPTION "Colors"
|
||||
XT_IDS_NEW "New"
|
||||
XT_IDS_CURRENT "Current"
|
||||
XT_IDS_DIRECTORIES " Directories:"
|
||||
XT_IDS_FILES " Files:"
|
||||
XT_IDS_RESTORE "This will restore the toolbar to it's original state, do you wish to continue?"
|
||||
XT_IDS_WINDOWS "More Windows..."
|
||||
XT_IDS_MANAGEKEYBRD "Manage Keyboard Shortcuts"
|
||||
XT_IDS_COMMAND "Command"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
XT_IDS_CLR_INDIGO "Indigo"
|
||||
XT_IDS_CLR_GRAY80 "Gray-80%"
|
||||
XT_IDS_CLR_DARK_RED "Dark Red"
|
||||
XT_IDS_CLR_ORANGE "Orange"
|
||||
XT_IDS_CLR_DARK_YELLOW "Dark Yellow"
|
||||
XT_IDS_CLR_GREEN "Green"
|
||||
XT_IDS_CLR_TEAL "Teal"
|
||||
XT_IDS_CLR_BLUE "Blue"
|
||||
XT_IDS_CLR_BLUEGRAY "Blue Gray"
|
||||
XT_IDS_CLR_GRAY50 "Gray-50%"
|
||||
XT_IDS_CLR_RED "Red"
|
||||
XT_IDS_CLR_LIGHTORANGE "Light Orange"
|
||||
XT_IDS_CLR_LIME "Lime"
|
||||
XT_IDS_CLR_SEA_GREEN "Sea Green"
|
||||
XT_IDS_CLR_AQUA "Aqua"
|
||||
XT_IDS_CLR_LIGHT_BLUE "Light Blue"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
XT_IDS_CLR_VIOLET "Violet"
|
||||
XT_IDS_CLR_GRAY40 "Gray-40%"
|
||||
XT_IDS_CLR_PINK "Pink"
|
||||
XT_IDS_CLR_GOLD "Gold"
|
||||
XT_IDS_CLR_YELLOW "Yellow"
|
||||
XT_IDS_CLR_BRIGHT_GREEN "Bright Green"
|
||||
XT_IDS_CLR_TURQUOISE "Turquiose"
|
||||
XT_IDS_CLR_SKY_BLUE "Sky Blue"
|
||||
XT_IDS_CLR_PLUM "Plum"
|
||||
XT_IDS_CLR_GRAY25 "Gray-25%"
|
||||
XT_IDS_CLR_ROSE "Rose"
|
||||
XT_IDS_CLR_TAN "Tan"
|
||||
XT_IDS_CLR_LIGHT_YELLOW "Light Yellow"
|
||||
XT_IDS_CLR_LIGHT_GREEN "Light Green"
|
||||
XT_IDS_CLR_LIGHT_TURQUOISE "Light Turquoise"
|
||||
XT_IDS_CLR_PALE_BLUE "Pale Blue"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
XT_IDS_CLR_LAVENDER "Lavender"
|
||||
XT_IDS_CLR_WHITE "White"
|
||||
XT_IDS_CLR_GRAY "Gray"
|
||||
XT_IDS_CLR_MAROON "Maroon"
|
||||
XT_IDS_CLR_OLIVE "Olive"
|
||||
XT_IDS_CLR_NAVY "Navy"
|
||||
XT_IDS_CLR_PURPLE "Purple"
|
||||
XT_IDS_CLR_SILVER "Silver"
|
||||
XT_IDS_CLR_FUCHSIA "Fuchsia"
|
||||
XT_IDS_CLR_NOFILL "No Fill"
|
||||
XT_IDS_CLR_NOFILL_TIP "No Color"
|
||||
XT_IDS_AUTOMATIC "Automatic"
|
||||
XT_IDS_AUTOMATIC_TIP "Automatic Color"
|
||||
XT_IDS_MORE_COLORS "More Colors..."
|
||||
XT_IDS_MORE_COLORS_TIP "More Colors"
|
||||
XT_IDS_STD_COLORS "Standard Colors"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
XT_IDC_BTN_DOWN "Move Item Down (Alt+Down Arrow)"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
AFX_ID_PREVIEW_CLOSE "Close the preview\nClose Preview"
|
||||
AFX_ID_PREVIEW_NUMPAGE "Display single page or double page view\n1 Page / 2 Page"
|
||||
AFX_ID_PREVIEW_NEXT "Go to the next page\nNext Page"
|
||||
AFX_ID_PREVIEW_PREV "Go to the previous page\nPrevious Page"
|
||||
AFX_ID_PREVIEW_PRINT "Print the previewed item\nPrint"
|
||||
AFX_ID_PREVIEW_ZOOMIN "Increase magnification of preview page\nZoom In"
|
||||
AFX_ID_PREVIEW_ZOOMOUT "Decrease magnification of preview page\nZoom Out"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
XT_IDS_KEYS "Keys"
|
||||
XT_IDS_DESCRIPTION "Description"
|
||||
XT_IDS_ALLCOMMANDS "[All Commands]"
|
||||
XT_IDS_REASSIGN "This shortcut is currently assigned to the command: %s\n\nDo you want to re-assign this shortcut?"
|
||||
XT_IDS_WIND_MINIMIZE "Minimize Window"
|
||||
XT_IDS_WIND_RESTORE "Restore Window"
|
||||
XT_IDS_WIND_CLOSE "Close Window"
|
||||
XT_IDS_TOOLBAR_OPTS "Toolbar Options"
|
||||
XT_IDS_TOOLS "&Tools"
|
||||
XT_IDS_PATH_INVALID "The path is invalid."
|
||||
XT_IDS_AREYOUSURE "Are you sure you want to reset the key assignments? This action will remove all custom key assignments at the text level."
|
||||
XT_IDS_AREYOUSURE_2 "This will delete the record of the commands you've used in this application and restore the default set of visible commands to the menus and toolbars. It will not undo any explicit customizations. Are you sure you want to do this?"
|
||||
XT_IDS_BROWSE "Browse"
|
||||
XT_IDS_BROWSE_FILTER "Executable (*.exe)|*.exe|Command (*.com)|*.com|Information (*.pif)|*.pif|Batch (*.bat;*.cmd)|*.bat; *.cmd|All Files (*.*)|*.*||"
|
||||
XT_IDS_MENU_CONTENTS " &Menu contents:"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
XT_IDS_ANIM_SYSDEF "(System default)"
|
||||
XT_IDS_ANIM_RANDOM "Random"
|
||||
XT_IDS_ANIM_UNFOLD "Unfold"
|
||||
XT_IDS_ANIM_SLIDE "Slide"
|
||||
XT_IDS_ANIM_FADE "Fade"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
216
Editor/XT/Include/XTSearchOptionsCtrl.h
Normal file
216
Editor/XT/Include/XTSearchOptionsCtrl.h
Normal file
@@ -0,0 +1,216 @@
|
||||
// XTSearchOptionsCtrl.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTSEARCHOPTIONSCTRL_H__)
|
||||
#define __XTSEARCHOPTIONSCTRL_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTSearchOptionsCtrl is a CStatic derived class. CXTSearchOptionsCtrl
|
||||
// is used to create a control similar to the Search Options item found
|
||||
// in the search pane of Windows Explorer as is seen in Windows 2000 and
|
||||
// later. This class allows you to associate a group of controls to be
|
||||
// hidden or shown when the item is expanded and contracted, and a set
|
||||
// of controls that need to move depending on the CXTSearchOptionsCtrl state.
|
||||
//
|
||||
// Use with CXTSearchOptionsView form view class to create a pane similar
|
||||
// to the Windows Explorer search pane. To use the control, define a set
|
||||
// of controls that are to be hidden and moved depending on the
|
||||
// CXTSearchOptionsCtrl state.
|
||||
//
|
||||
// Example: <pre>
|
||||
// void CExpandTestView::OnInitialUpdate()
|
||||
// {
|
||||
// CXTSearchOptionsView::OnInitialUpdate();
|
||||
//
|
||||
// m_expand.AddControl(&m_check1);
|
||||
// m_expand.AddControl(&m_check2);
|
||||
// m_expand.AddControl(&m_edit1);
|
||||
// m_expand.AddControl(&m_edit2);
|
||||
//
|
||||
// m_expand.MoveControl(&m_button1);
|
||||
// m_expand.MoveControl(&m_button2);
|
||||
// m_expand.MoveControl(&m_combo1);
|
||||
//
|
||||
// m_expand.SetLabelText(
|
||||
// _T("Search Options <<"), _T("Search Options >>"));
|
||||
// }</pre>
|
||||
//
|
||||
// See the "SearchOptions" demo for a complete example.
|
||||
class _XT_EXT_CLASS CXTSearchOptionsCtrl : public CStatic
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTSearchOptionsCtrl)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTSearchOptionsCtrl object.
|
||||
CXTSearchOptionsCtrl();
|
||||
|
||||
// Summary: Destroys a CXTSearchOptionsCtrl object, handles cleanup and de-allocation.
|
||||
virtual ~CXTSearchOptionsCtrl();
|
||||
|
||||
protected:
|
||||
|
||||
int m_iMinSize; // Height of the control when contracted.
|
||||
int m_iMaxSize; // Height of the control when expanded.
|
||||
bool m_bExpanded; // true when the control is expanded.
|
||||
CRect m_rcLabel; // Size of the label that is displayed.
|
||||
DWORD m_dwInitSignature; // used for one-time initialization.
|
||||
CString m_strExpandLabel; // Label to display when the control is expanded.
|
||||
CString m_strContractLabel; // Label to display when the control is contracted.
|
||||
CPtrArray m_arHideCtrls; // List of controls to show or hide.
|
||||
CPtrArray m_arMoveCtrls; // List of controls to move when expanded or contracted.
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Input: pWndCtrl - Points to a valid CWnd object to hide.
|
||||
// Summary: Call this member function to add a control to the list of controls
|
||||
// that are displayed when the hide item control is expanded.
|
||||
void AddControl(CWnd* pWndCtrl);
|
||||
|
||||
// Input: pWndCtrl - Points to a valid CWnd object to move.
|
||||
// Summary: Call this member function to add a control to the list of controls
|
||||
// that are moved when the hide item control is expanded or contracted.
|
||||
void MoveControl(CWnd* pWndCtrl);
|
||||
|
||||
// Input: lpszExpand - NULL terminated string that represents the text displayed when
|
||||
// the control is expanded.
|
||||
// lpszContract - NULL terminated string that represents the text displayed when
|
||||
// the control is contracted.
|
||||
// Summary: Call this member function to set the text that is displayed when the
|
||||
// hide item control is expanded or contracted.
|
||||
void SetLabelText(LPCTSTR lpszExpand,LPCTSTR lpszContract);
|
||||
|
||||
// Summary: Call this member function to expand the hide item control and display
|
||||
// CWnd objects contained in the hide item list. Called by the control
|
||||
// whenever the user clicks on the expand label.
|
||||
void Expand();
|
||||
|
||||
// Summary: Call this member function to contract the hide item control and hide
|
||||
// CWnd objects contained in the hide item list. Called by the control
|
||||
// whenever the user clicks on the contract label.
|
||||
void Contract();
|
||||
|
||||
// Returns: An integer value that represents the height of the
|
||||
// control when it is contracted.
|
||||
// Summary: Call this member function to return the minimum height of the hide
|
||||
// item control.
|
||||
int GetMinSize();
|
||||
|
||||
// Returns: An integer value that represents the height of the
|
||||
// control when it is expanded.
|
||||
// Summary: Call this member function to return the maximum height of the hide
|
||||
// item control.
|
||||
int GetMaxSize();
|
||||
|
||||
// Returns: An integer value that represents the distance that controls will be moved.
|
||||
// Summary: Call this member function to return the offset size for the
|
||||
// CXTSearchOptionsCtrl object. This is the distance that controls will
|
||||
// be moved to accommodate for the expansion and contraction of the control.
|
||||
// Also used by CXTSearchOptionsView for adjusting scroll sizes.
|
||||
int GetOffsetSize();
|
||||
|
||||
protected:
|
||||
|
||||
// Summary: defers control initialization
|
||||
void DeferInitialUpdate();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTSearchOptionsCtrl)
|
||||
protected:
|
||||
virtual void PreSubclassWindow();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTSearchOptionsCtrl)
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
|
||||
//}}AFX_MSG
|
||||
afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE int CXTSearchOptionsCtrl::GetMinSize() {
|
||||
return m_iMinSize;
|
||||
}
|
||||
AFX_INLINE int CXTSearchOptionsCtrl::GetMaxSize() {
|
||||
return m_iMaxSize;
|
||||
}
|
||||
AFX_INLINE int CXTSearchOptionsCtrl::GetOffsetSize() {
|
||||
return GetMaxSize()-GetMinSize();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTSearchOptionsView is a CXTResizeFormView derived helper class. It
|
||||
// is to be used with a CXTSearchOptionsCtrl object. It is used to paint
|
||||
// the background and control background color white.
|
||||
class _XT_EXT_CLASS CXTSearchOptionsView : public CXTResizeFormView
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTSearchOptionsView)
|
||||
|
||||
protected:
|
||||
|
||||
// Input: nID - Contains the ID number of a dialog template resource.
|
||||
// nFlags - Flags that are to be passed to CXTResize that specify the attributes
|
||||
// of the resizing property page. They can be one or more of the following,
|
||||
// and can be combined using the or (|) operator:
|
||||
// [ul]
|
||||
// [li]<b>SZ_NOSIZEICON</b> Do not add size icon.[/li]
|
||||
// [li]<b>SZ_NOHORISONTAL</b> No horizontal resizing.[/li]
|
||||
// [li]<b>SZ_NOVERTICAL</b> No vertical resizing.[/li]
|
||||
// [li]<b>SZ_NOMINSIZE</b> Do not require a minimum size.[/li]
|
||||
// [li]<b>SZ_NOCLIPCHILDREN</b> Do not set clip children style.[/li]
|
||||
// [li]<b>SZ_NOTRANSPARENTGROUP</b> Do not set transparent style
|
||||
// for group boxes.[/li]
|
||||
// [/ul]
|
||||
// Summary: Constructs a CXTSearchOptionsView object, same as if you were constructing
|
||||
// a CXTResizeFormView object.
|
||||
CXTSearchOptionsView(const UINT nID = 0,const UINT nFlags = 0);
|
||||
|
||||
// Summary: Destroys a CXTSearchOptionsView object, handles cleanup and de-allocation.
|
||||
virtual ~CXTSearchOptionsView();
|
||||
|
||||
HBRUSH m_hBrush; // Handle to the current background brush.
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTSearchOptionsView)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTSearchOptionsView)
|
||||
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(__XTSEARCHOPTIONSCTRL_H__)
|
||||
245
Editor/XT/Include/XTShellListCtrl.h
Normal file
245
Editor/XT/Include/XTShellListCtrl.h
Normal file
@@ -0,0 +1,245 @@
|
||||
// XTShellListCtrl.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTSHELLLISTCTRL_H__)
|
||||
#define __XTSHELLLISTCTRL_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTShellListCtrl is a multiple inheritance class derived from CXTListCtrl
|
||||
// and CXTShellPidl. It is used to create a CXTShellListCtrl window.
|
||||
class _XT_EXT_CLASS CXTShellListCtrl : public CXTListCtrl, public CXTShellPidl
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTShellListCtrl object.
|
||||
CXTShellListCtrl();
|
||||
|
||||
// Summary: Destroys a CXTShellListCtrl object, handles cleanup and de-allocation.
|
||||
virtual ~CXTShellListCtrl();
|
||||
|
||||
protected:
|
||||
|
||||
UINT m_uFlags; // Flags indicating which items to include in the enumeration.
|
||||
BOOL m_bContextMenu; // TRUE to display the shell context menu on right item click.
|
||||
CWnd* m_pTreeCtrl; // Window that receives update notification, usually a CXTShellTreeCtrl.
|
||||
LPITEMIDLIST m_pidlINet; // Points to the CSIDL_INTERNET folder location.
|
||||
CXTShellSettings m_shSettings; // Contains SHELLFLAGSTATE info.
|
||||
|
||||
// Input: lptvid - Pointer to tree view item data.
|
||||
// lpsf - Pointer to the parent shell folder.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds items to the list view.
|
||||
virtual BOOL InitListViewItems(XT_TVITEMDATA* lptvid,LPSHELLFOLDER lpsf);
|
||||
|
||||
// Input: lpifq - Fully qualified item ID list for the current item.
|
||||
// lptvitem - Pointer to a tree view item about to be added to the tree.
|
||||
// Summary: This member function gets the index for the normal and selected icons
|
||||
// of the current item.
|
||||
virtual void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq,LPTV_ITEM lptvitem);
|
||||
|
||||
public:
|
||||
|
||||
// Input: bEnable - TRUE to display a context menu.
|
||||
// Summary: Call this member function to enable or disable the display of the shell
|
||||
// context menu on the right click of an item.
|
||||
virtual void EnableContextMenu(BOOL bEnable);
|
||||
|
||||
// Input: uFlags - Determines the type of items included in an enumeration, and can
|
||||
// be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>SHCONTF_FOLDERS</b> Include items that are folders in
|
||||
// the enumeration.[/li]
|
||||
// [li]<b>SHCONTF_NONFOLDERS</b> Include items that are not folders
|
||||
// in the enumeration.[/li]
|
||||
// [li]<b>SHCONTF_INCLUDEHIDDEN</b> Include hidden items in the
|
||||
// enumeration.[/li]
|
||||
// [li]<b>SHCONTF_INIT_ON_FIRST_NEXT</b> IShellFolder::EnumObjects
|
||||
// can return without validating the enumeration object. Validation
|
||||
// can be postponed until the first call to IEnumIDList::Next.
|
||||
// This flag is intended to be used when a user interface may be
|
||||
// displayed prior to the first IEnumIDList::Next call. For a
|
||||
// user interface to be presented, 'hwndOwner' must be set to a valid
|
||||
// window handle.[/li]
|
||||
// [li]<b>SHCONTF_NETPRINTERSRCH</b> The caller is looking for
|
||||
// printer objects.[/li]
|
||||
// [/ul]
|
||||
// Summary: Call this member function to determine the type of items included
|
||||
// in the shell enumeration. Default is SHCONTF_FOLDERS | SHCONTF_NONFOLDERS.
|
||||
virtual void SetEnumFlags(UINT uFlags);
|
||||
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function associates the system image list with the list
|
||||
// control.
|
||||
virtual BOOL InitSystemImageLists();
|
||||
|
||||
// Input: lptvid - Pointer to TreeView item data
|
||||
// lpsf - Pointer to the parent shell folder.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function populates the list view control.
|
||||
virtual BOOL PopulateListView(XT_TVITEMDATA* lptvid,LPSHELLFOLDER lpsf);
|
||||
|
||||
// Returns: The index of the item that was double clicked, or -1, if the item was
|
||||
// not found.
|
||||
// Summary: This member function returns the index of the list view item that
|
||||
// was double clicked on.
|
||||
virtual int GetDoubleClickedItem();
|
||||
|
||||
// Returns: The index of the item selected, or -1, if the item was not found.
|
||||
// Summary: This member function displays the system popup menu for the selected
|
||||
// item or folder.
|
||||
virtual int GetContextMenu();
|
||||
|
||||
// Input: iItem - Index of the list view item clicked on.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function executes, via the Shell, the item clicked on
|
||||
// in the list control.
|
||||
virtual bool ShellOpenItem(int iItem);
|
||||
|
||||
// Input: lplvid - Pointer to the list view item data.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function executes, via the Shell, the item clicked on
|
||||
// in the list control.
|
||||
virtual bool ShellOpenItem(XT_LVITEMDATA* lplvid);
|
||||
|
||||
// Input: iItem - Index of the list view item to get the path of.
|
||||
// strItemPath - Reference to a CString object that receives the path string.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function retrieves the path of the specified list view item.
|
||||
virtual BOOL GetItemPath(int iItem,CString &strItemPath);
|
||||
|
||||
// This member function creates default columns for the list view.
|
||||
virtual void BuildDefaultColumns();
|
||||
|
||||
// Input: nCol - Passed in from the control. The index of the column clicked.
|
||||
// bAscending - Passed in from the control, true if the sort order should
|
||||
// be ascending.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Override this member function in your derived class to perform custom
|
||||
// sort routines.
|
||||
virtual bool SortList(int nCol,bool bAscending );
|
||||
|
||||
// Input: pWnd - Points to the tree control that is associated with the list.
|
||||
// Summary: Call this member function to associate the tree control with the list.
|
||||
virtual void AssociateTree(CWnd* pWnd);
|
||||
|
||||
// Call this member function to initialize the shell list control.
|
||||
virtual void InitializeControl();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTShellListCtrl)
|
||||
protected:
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual void OnDragDrop(NM_LISTVIEW* pNMListView);
|
||||
virtual TCHAR* InsertCommas(LONGLONG value, TCHAR* szBufferOut, UINT nSize);
|
||||
|
||||
protected:
|
||||
|
||||
// Input: iItem - Index of the item to set the attributes for.
|
||||
// dwAttributes - Flags retrieved from SHELLFOLDER::GetAttributesOf.
|
||||
// Summary: This member function sets the shell attribute flags for the specified
|
||||
// list item.
|
||||
virtual void SetAttributes(int iItem,DWORD dwAttributes);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTShellListCtrl)
|
||||
afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnBeginRDrag(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
//}}AFX_MSG
|
||||
afx_msg LRESULT OnUpdateShell(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnInitControl(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#define CXTShellList CXTShellListCtrl
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTShellListCtrl::SetEnumFlags(UINT uFlags) {
|
||||
m_uFlags = uFlags;
|
||||
}
|
||||
AFX_INLINE void CXTShellListCtrl::AssociateTree(CWnd* pWnd) {
|
||||
ASSERT_VALID(pWnd); m_pTreeCtrl = pWnd;
|
||||
}
|
||||
AFX_INLINE void CXTShellListCtrl::EnableContextMenu(BOOL bEnable) {
|
||||
m_bContextMenu = bEnable;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTShellListCtrlEx is a CXTShellListCtrl derived class. It is used to create
|
||||
// a stand-alone shell list control that is not dependant on a CXTShellTreeCtrl
|
||||
// for initialization. It is used to create a CXTShellListCtrlEx window for
|
||||
// displaying the contents of file folders.
|
||||
class _XT_EXT_CLASS CXTShellListCtrlEx : public CXTShellListCtrl
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTShellListCtrlEx object.
|
||||
CXTShellListCtrlEx();
|
||||
|
||||
// Summary: Destroys a CXTShellListCtrlEx object, handles cleanup and de-allocation.
|
||||
virtual ~CXTShellListCtrlEx();
|
||||
|
||||
protected:
|
||||
|
||||
CWnd* m_pSyncWnd; // Points to the window to synchronize with the shell list control.
|
||||
CString m_strItemPath; // A NULL terminated string that represents the currently selected folder.
|
||||
|
||||
public:
|
||||
|
||||
// Input: lpszPath - A NULL terminated string that represents the folder to select.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function is called to browse to a particular file folder.
|
||||
bool BrowseToFolder(LPCTSTR lpszPath);
|
||||
|
||||
// Input: pSyncWnd - Points to a valid CWnd object.
|
||||
// Summary: This member function will associate a CWnd object with the shell list control. This
|
||||
// window is usually a CEdit control, but can be any CWnd object. This window will have
|
||||
// its window text updated whenever the selected folder is changed.
|
||||
void SetSyncWnd(CWnd* pSyncWnd);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTShellListCtrlEx)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTShellListCtrlEx)
|
||||
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTShellListCtrlEx::SetSyncWnd(CWnd* pSyncWnd) {
|
||||
m_pSyncWnd = pSyncWnd;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(__XTSHELLLISTCTRL_H__)
|
||||
184
Editor/XT/Include/XTShellListView.h
Normal file
184
Editor/XT/Include/XTShellListView.h
Normal file
@@ -0,0 +1,184 @@
|
||||
// XTShellListView.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __XTSHELLLISTVIEW_H__
|
||||
#define __XTSHELLLISTVIEW_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTShellListView is a multiple inheritance class derived from CXTListView
|
||||
// and CXTShellPidl. It is used to create a CXTShellListView class object.
|
||||
class _XT_EXT_CLASS CXTShellListView : public CXTListView, public CXTShellPidl
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTShellListView)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTShellListView object.
|
||||
CXTShellListView();
|
||||
|
||||
// Summary: Destroys a CXTShellListView object, handles cleanup and de-allocation.
|
||||
virtual ~CXTShellListView();
|
||||
|
||||
protected:
|
||||
|
||||
UINT m_uFlags; // Flags indicating which items to include in the enumeration.
|
||||
BOOL m_bUninitOLE; // TRUE if OleUninitialize has to be called.
|
||||
BOOL m_bContextMenu; // TRUE to display the shell context menu on right item click.
|
||||
LPITEMIDLIST m_pidlINet; // Points to the CSIDL_INTERNET folder location.
|
||||
CXTShellSettings m_shSettings; // Contains SHELLFLAGSTATE info.
|
||||
|
||||
// Input: lptvid - Pointer to tree view item data.
|
||||
// lpsf - Pointer to the parent shell folder.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function adds items to the list view.
|
||||
virtual BOOL InitListViewItems(XT_TVITEMDATA* lptvid,LPSHELLFOLDER lpsf);
|
||||
|
||||
// Input: lpifq - Fully qualified item ID list for the current item.
|
||||
// lptvitem - Pointer to the tree view item about to be added to the tree.
|
||||
// Summary: This member function gets the index for the normal and selected
|
||||
// icons of the current item.
|
||||
virtual void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq,LPTV_ITEM lptvitem);
|
||||
|
||||
public:
|
||||
|
||||
// Input: bEnable - TRUE to display a context menu.
|
||||
// Summary: Call this member function to enable or disable the display of the
|
||||
// shell context menu on the right click of the item.
|
||||
virtual void EnableContextMenu(BOOL bEnable);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: uFlags - Determines the type of items included in an enumeration, and can
|
||||
// be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>SHCONTF_FOLDERS</b> Include items that are folders in
|
||||
// the enumeration.[/li]
|
||||
// [li]<b>SHCONTF_NONFOLDERS</b> Include items that are not folders
|
||||
// in the enumeration.[/li]
|
||||
// [li]<b>SHCONTF_INCLUDEHIDDEN</b> Include hidden items in the
|
||||
// enumeration.[/li]
|
||||
// [li]<b>SHCONTF_INIT_ON_FIRST_NEXT</b> IShellFolder::EnumObjects
|
||||
// can return without validating the enumeration object. Validation
|
||||
// can be postponed until the first call to IEnumIDList::Next.
|
||||
// This flag is intended to be used when a user interface may be
|
||||
// displayed prior to the first IEnumIDList::Next call. For a
|
||||
// user interface to be presented, 'hwndOwner' must be set to a valid
|
||||
// window handle.[/li]
|
||||
// [li]<b>SHCONTF_NETPRINTERSRCH</b> The caller is looking for
|
||||
// printer objects.[/li]
|
||||
// [/ul]
|
||||
// Summary: Call this member function to determine the type of items included
|
||||
// in the shell enumeration. The default is SHCONTF_FOLDERS | SHCONTF_NONFOLDERS.
|
||||
virtual void SetEnumFlags(UINT uFlags);
|
||||
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function associates the system image list with the list
|
||||
// control.
|
||||
virtual BOOL InitSystemImageLists();
|
||||
|
||||
// Input: lptvid - Pointer to TreeView item data.
|
||||
// lpsf - Pointer to the parent shell folder.
|
||||
// Returns: TRUE if successful, otherwise return FALSE.
|
||||
// Summary: This member function populates the list view control.
|
||||
virtual BOOL PopulateListView(XT_TVITEMDATA* lptvid,LPSHELLFOLDER lpsf);
|
||||
|
||||
// Returns: The index of the item that was double clicked, or -1, if the item
|
||||
// was not found.
|
||||
// Summary: This member function returns the index of the list view item that
|
||||
// was double clicked on.
|
||||
virtual int GetDoubleClickedItem();
|
||||
|
||||
// Returns: The index of the item selected, or -1, if the item was not found.
|
||||
// Summary: This member function displays the system popup menu for the selected
|
||||
// item or folder.
|
||||
virtual int GetContextMenu();
|
||||
|
||||
// Input: iItem - Index of the list view item clicked on.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function executes, via the Shell, the item clicked on
|
||||
// in the list control.
|
||||
virtual bool ShellOpenItem(int iItem);
|
||||
|
||||
// Input: lplvid - Pointer to the list view item data.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function executes, via the Shell, the item clicked on
|
||||
// in the list control.
|
||||
virtual bool ShellOpenItem(XT_LVITEMDATA* lplvid);
|
||||
|
||||
// Input: iItem - Index of the list view item to get the path of.
|
||||
// strItemPath - Reference to a CString object that receives the path string.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function retrieves the path for the specified list view
|
||||
// item.
|
||||
virtual BOOL GetItemPath(int iItem,CString &strItemPath);
|
||||
|
||||
// Summary: This member function creates default columns for the list view.
|
||||
virtual void BuildDefaultColumns();
|
||||
|
||||
// Input: nCol - Passed in from the control. The index of the column clicked.
|
||||
// bAscending - Passed in from the control. true if the sort order should be ascending.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: Override this member function in your derived class to perform custom
|
||||
// sort routines.
|
||||
virtual bool SortList(int nCol,bool bAscending );
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTShellListView)
|
||||
public:
|
||||
virtual void OnInitialUpdate();
|
||||
protected:
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual void OnDragDrop(NM_LISTVIEW* pNMListView);
|
||||
virtual TCHAR* InsertCommas(LONGLONG value, TCHAR* szBufferOut, UINT nSize);
|
||||
|
||||
protected:
|
||||
|
||||
// Input: iItem - Index of the item to set the attributes for.
|
||||
// dwAttributes - Flags retrieved from SHELLFOLDER::GetAttributesOf.
|
||||
// Summary: This member function sets the shell attribute flags for the specified
|
||||
// list item.
|
||||
virtual void SetAttributes(int iItem,DWORD dwAttributes);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTShellListView)
|
||||
afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnBeginRDrag(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTShellListView::SetEnumFlags(UINT uFlags) {
|
||||
m_uFlags = uFlags;
|
||||
}
|
||||
AFX_INLINE void CXTShellListView::EnableContextMenu(BOOL bEnable) {
|
||||
m_bContextMenu = bEnable;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // __XTSHELLLISTVIEW_H__
|
||||
162
Editor/XT/Include/XTShellPidl.h
Normal file
162
Editor/XT/Include/XTShellPidl.h
Normal file
@@ -0,0 +1,162 @@
|
||||
// XTShellPidl.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __XTSHELLPIDL_H__
|
||||
#define __XTSHELLPIDL_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
LRESULT CALLBACK HookWndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTShellPidl is a stand alone base class. This class is used by the
|
||||
// shell tree and list controls to handle PIDL creation and management.
|
||||
class _XT_EXT_CLASS CXTShellPidl
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTShellPidl object.
|
||||
CXTShellPidl();
|
||||
|
||||
// Summary: Destroys a CXTShellPidl object, handles cleanup and de-allocation.
|
||||
virtual ~CXTShellPidl();
|
||||
|
||||
public:
|
||||
|
||||
// Input: path - File system path string.
|
||||
// Returns: A pointer to an item ID list. Returns NULL if it fails.
|
||||
// Summary: This member function gets the fully qualified PIDL for the path string.
|
||||
LPITEMIDLIST IDLFromPath(CString path);
|
||||
|
||||
// Input: pidlPath - Fully qualified PIDL.
|
||||
// Returns: A fully qualified parent PIDL.
|
||||
// Summary: This member function performs the OneUp or back function.
|
||||
LPITEMIDLIST OneUpPIDL(LPITEMIDLIST pidlPath);
|
||||
|
||||
// Input: path - Path string.
|
||||
// Returns: A path string to the parent.
|
||||
// Summary: This member function gets the parent folder using PIDLs.
|
||||
CString OneUpPATH(CString path);
|
||||
|
||||
// Input: pidl - PIDL list.
|
||||
// Returns: A pointer to the last IDL in the list.
|
||||
// Summary: This member function walks an ITEMIDLIST and points to the last one.
|
||||
LPITEMIDLIST GetLastITEM(LPITEMIDLIST pidl);
|
||||
|
||||
// Input: pidl - Pointer to an ITEMIDLIST.
|
||||
// Returns: A new pointer to a copy of the PIDL.
|
||||
// Summary: This member function copies a whole ITEMIDLIST. Remember to Free()
|
||||
// the old one if it is no longer needed.
|
||||
LPITEMIDLIST CopyIDList(LPITEMIDLIST pidl);
|
||||
|
||||
// Input: pidl1 - Pointer to an item ID list.
|
||||
// pidl2 - Pointer to an item ID list.
|
||||
// Returns: A pointer to an item ID list.
|
||||
// Summary: This member function concatenates two PIDLs.
|
||||
LPITEMIDLIST ConcatPidls(LPCITEMIDLIST pidl1,LPCITEMIDLIST pidl2);
|
||||
|
||||
// Input: lpsf - Pointer to the parent shell folder.
|
||||
// lpi - Pointer to the item ID that is relative to 'lpsf'.
|
||||
// Returns: A pointer to an item ID list.
|
||||
// Summary: This member function gets the fully qualified PIDLs for the specified
|
||||
// folder.
|
||||
LPITEMIDLIST GetFullyQualPidl(LPSHELLFOLDER lpsf,LPITEMIDLIST lpi);
|
||||
|
||||
// Input: lpMalloc - Points to the shell<6C>s IMalloc interface.
|
||||
// lpi - Pointer to item ID that is to be copied.
|
||||
// Returns: A pointer to an item ID list.
|
||||
// Summary: This member function copies the ITEMID.
|
||||
LPITEMIDLIST DuplicateItem(LPMALLOC lpMalloc,LPITEMIDLIST lpi);
|
||||
|
||||
// Input: lpsf - Pointer to the parent shell folder.
|
||||
// lpi - Pointer to the item ID that is relative to 'lpsf'.
|
||||
// dwFlags - Flags to determine which value to return. See SHGNO for more details.
|
||||
// lpFriendlyName - Buffer to receive the friendly name of the folder.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function gets the friendly name for the folder or file.
|
||||
BOOL GetName(LPSHELLFOLDER lpsf,LPITEMIDLIST lpi,DWORD dwFlags,TCHAR* lpFriendlyName);
|
||||
|
||||
// Input: cbSize - Initial size of the PIDL.
|
||||
// Returns: A pointer to an item ID list.
|
||||
// Summary: This member function allocates a PIDL.
|
||||
LPITEMIDLIST CreatePidl(UINT cbSize);
|
||||
|
||||
// Input: pidl - Pointer to an item ID list.
|
||||
// Returns: The number of item IDs in the list.
|
||||
// Summary: This member function computes the number of item IDs in an item ID
|
||||
// list.
|
||||
UINT GetPidlItemCount(LPCITEMIDLIST pidl);
|
||||
|
||||
// Input: pidl - Pointer to an item ID list.
|
||||
// Returns: A pointer to the next PIDL item in the list.
|
||||
// Summary: This member function gets the next PIDL in the list.
|
||||
LPITEMIDLIST GetNextPidlItem(LPCITEMIDLIST pidl);
|
||||
|
||||
// Input: hwnd - Context menu owner.
|
||||
// lpsfParent - Pointer to the parent shell folder.
|
||||
// lpi - Pointer to the item ID that is relative to 'lpsfParent'.
|
||||
// nCount - Number of PIDLs.
|
||||
// lppt - Screen location of where to popup the menu.
|
||||
// Returns: TRUE on success, or FALSE on failure.
|
||||
// Summary: This member function displays a popup context menu, given a parent
|
||||
// shell folder, relative item ID, and screen location.
|
||||
BOOL ShowContextMenu(HWND hwnd,LPSHELLFOLDER lpsfParent,LPCITEMIDLIST *lpi,int nCount,LPPOINT lppt);
|
||||
|
||||
// Input: hwnd - Context menu owner.
|
||||
// lpsfParent - Pointer to the parent shell folder.
|
||||
// lpi - Pointer to the item ID that is relative to 'lpsfParent'.
|
||||
// lppt - Screen location of where to popup the menu.
|
||||
// Returns: TRUE on success, or FALSE on failure.
|
||||
// Summary: This member function displays a popup context menu, given a parent
|
||||
// shell folder, relative item ID, and screen location.
|
||||
BOOL ShowContextMenu(HWND hwnd,LPSHELLFOLDER lpsfParent,LPITEMIDLIST lpi,LPPOINT lppt);
|
||||
|
||||
// Input: lpi - Fully qualified item ID list for the current item.
|
||||
// uFlags - Flags for SHGetFileInfo().
|
||||
// Returns: An icon index for the current item.
|
||||
// Summary: This member function gets the index for the current icon. Index is
|
||||
// the index into the system image list.
|
||||
int GetItemIcon(LPITEMIDLIST lpi,UINT uFlags);
|
||||
|
||||
// Input: psfFolder - A pointer to a valid IShellFolder data type.
|
||||
// localPidl - A pointer to a valid _ITEMIDLIST structure.
|
||||
// nCount - Number of items in the context menu.
|
||||
// ppCM - Long pointer to a CONTEXTMENU struct.
|
||||
// pcmType - A pointer to a valid int data type that represents the version number
|
||||
// of the context menu.
|
||||
// Returns: An HRESULT value.
|
||||
// Summary: This member function gets the IContextMenu, IContextMenu2 or IContextMenu3
|
||||
// interface.
|
||||
HRESULT GetSHContextMenu(LPSHELLFOLDER psfFolder,LPCITEMIDLIST *localPidl,int nCount,void** ppCM,int* pcmType);
|
||||
|
||||
protected:
|
||||
virtual void OnShowContextMenu(int idCmd, CMINVOKECOMMANDINFO& cmi);
|
||||
|
||||
private:
|
||||
|
||||
static WNDPROC m_pOldWndProc; // regular window proc
|
||||
static LPCONTEXTMENU2 m_pIContext2; // active shell context menu
|
||||
|
||||
static LRESULT CALLBACK HookWndProc(
|
||||
HWND hWnd,
|
||||
UINT msg,
|
||||
WPARAM wp,
|
||||
LPARAM lp);
|
||||
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // __XTSHELLPIDL_H__
|
||||
139
Editor/XT/Include/XTShellSettings.h
Normal file
139
Editor/XT/Include/XTShellSettings.h
Normal file
@@ -0,0 +1,139 @@
|
||||
// XTShellSettings.h: interface for the CXTShellSettings class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTSHELLSETTINGS_H__)
|
||||
#define __XTSHELLSETTINGS_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTShellSettings is a SHELLFLAGSTATE struct derived class. CXTShellSettings
|
||||
// extends the SHELLFLAGSTATE struct for easy access to the shell flag
|
||||
// state settings.
|
||||
class _XT_EXT_CLASS CXTShellSettings : public SHELLFLAGSTATE
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTShellSettings object.
|
||||
CXTShellSettings();
|
||||
|
||||
// Summary: Destroys a CXTShellSettings object, handles cleanup and de-allocation.
|
||||
virtual ~CXTShellSettings();
|
||||
|
||||
public:
|
||||
|
||||
// Returns: true if enabled, otherwise returns false.
|
||||
// Summary: This member function checks to see if the Show All Files option is
|
||||
// enabled.
|
||||
bool ShowAllFiles();
|
||||
|
||||
// Returns: true if enabled, otherwise returns false.
|
||||
// Summary: This member function checks to see if the Hide File Extensions for
|
||||
// Known File Types option is disabled.
|
||||
bool ShowExtensions();
|
||||
|
||||
// Returns: true if enabled, otherwise returns false.
|
||||
// Summary: This member function checks to see if the Display Delete Confirmation
|
||||
// Dialog box in the Recycle Bin is enabled.
|
||||
bool NoConfirmRecycle();
|
||||
|
||||
// Returns: true if enabled, otherwise returns false.
|
||||
// Summary: This member function checks to see if the Do Not Show Hidden Files
|
||||
// option is selected.
|
||||
bool ShowSysFiles();
|
||||
|
||||
// Returns: true if enabled, otherwise returns false.
|
||||
// Summary: This member function checks to see if the Display Compressed Files
|
||||
// and Folders with Alternate Color option is enabled.
|
||||
bool ShowCompColor();
|
||||
|
||||
// Returns: true if enabled, otherwise returns false.
|
||||
// Summary: This member function checks to see if the Double-Click to Open an
|
||||
// Item option is enabled.
|
||||
bool DoubleClickOpen();
|
||||
|
||||
// Returns: true if enabled, otherwise returns false.
|
||||
// Summary: This member function checks to see if the Active Desktop <20> View as
|
||||
// Web Page option is enabled.
|
||||
bool HTMLDesktop();
|
||||
|
||||
// Returns: true if enabled, otherwise returns false.
|
||||
// Summary: This member function checks to see if the Classic Style option is
|
||||
// enabled.
|
||||
bool Win95Classic();
|
||||
|
||||
// Returns: true if enabled, otherwise returns false.
|
||||
// Summary: This member function checks to see if the Allow All Uppercase Names
|
||||
// option is enabled.
|
||||
bool AllowUpperCase();
|
||||
|
||||
// Returns: true if enabled, otherwise returns false.
|
||||
// Summary: This member function checks to see if the Show File Attributes in
|
||||
// Detail View option is enabled.
|
||||
bool ShowAttributes();
|
||||
|
||||
// Returns: true if enabled, otherwise returns false.
|
||||
// Summary: This member function checks to see if the Show Map Network Drive
|
||||
// Button in Toolbar option is enabled.
|
||||
bool ShowMapNetworkDrive();
|
||||
|
||||
// Returns: true if enabled, otherwise returns false.
|
||||
// Summary: This member function checks to see if the Show Info Tips for Items
|
||||
// in Folders & Desktop option is enabled.
|
||||
bool ShowInfoTips();
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE bool CXTShellSettings::ShowAllFiles() {
|
||||
return fShowAllObjects != 0 ? true : false;
|
||||
}
|
||||
AFX_INLINE bool CXTShellSettings::ShowExtensions() {
|
||||
return fShowExtensions != 0 ? true : false;
|
||||
}
|
||||
AFX_INLINE bool CXTShellSettings::NoConfirmRecycle() {
|
||||
return fNoConfirmRecycle != 0 ? true : false;
|
||||
}
|
||||
AFX_INLINE bool CXTShellSettings::ShowSysFiles() {
|
||||
return fShowSysFiles != 0 ? true : false;
|
||||
}
|
||||
AFX_INLINE bool CXTShellSettings::ShowCompColor() {
|
||||
return fShowCompColor != 0 ? true : false;
|
||||
}
|
||||
AFX_INLINE bool CXTShellSettings::DoubleClickOpen() {
|
||||
return fDoubleClickInWebView != 0 ? true : false;
|
||||
}
|
||||
AFX_INLINE bool CXTShellSettings::HTMLDesktop() {
|
||||
return fDesktopHTML != 0 ? true : false;
|
||||
}
|
||||
AFX_INLINE bool CXTShellSettings::Win95Classic() {
|
||||
return fWin95Classic != 0 ? true : false;
|
||||
}
|
||||
AFX_INLINE bool CXTShellSettings::AllowUpperCase() {
|
||||
return fDontPrettyPath != 0 ? true : false;
|
||||
}
|
||||
AFX_INLINE bool CXTShellSettings::ShowAttributes() {
|
||||
return fShowAttribCol != 0 ? true : false;
|
||||
}
|
||||
AFX_INLINE bool CXTShellSettings::ShowMapNetworkDrive() {
|
||||
return fMapNetDrvBtn != 0 ? true : false;
|
||||
}
|
||||
AFX_INLINE bool CXTShellSettings::ShowInfoTips() {
|
||||
return fShowInfoTip != 0 ? true : false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // !defined(__XTSHELLSETTINGS_H__)
|
||||
250
Editor/XT/Include/XTShellTreeCtrl.h
Normal file
250
Editor/XT/Include/XTShellTreeCtrl.h
Normal file
@@ -0,0 +1,250 @@
|
||||
// XTShellTreeCtrl.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTSHELLTREECTRL_H__)
|
||||
#define __XTSHELLTREECTRL_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTShellTreeCtrl is a multiple inheritance class derived from CXTTreeCtrl
|
||||
// and CXTShellPidl. CXTShellTreeCtrl is used to create a tree control
|
||||
// that displays an explorer style tree, and can be associated with a combo box
|
||||
// and list control.
|
||||
class _XT_EXT_CLASS CXTShellTreeCtrl : public CXTTreeCtrl, public CXTShellPidl
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTShellTreeCtrl object.
|
||||
CXTShellTreeCtrl();
|
||||
|
||||
// Summary: Destroys a CXTShellTreeCtrl object, handles cleanup and de-allocation.
|
||||
virtual ~CXTShellTreeCtrl();
|
||||
|
||||
protected:
|
||||
|
||||
UINT m_uFlags; // Flags indicating which items to include in the enumeration.
|
||||
BOOL m_bContextMenu; // TRUE to display the shell context menu on right item click.
|
||||
BOOL m_bAutoInit; // TRUE if the tree control is to initialize when created.
|
||||
BOOL m_bContentInitPending; // TRUE if content initialization is pending.
|
||||
BOOL m_bTunnelPath; // TRUE if tunnel initialization is pending.
|
||||
bool m_bTunneling; // true if tree is currently traversing.
|
||||
CWnd* m_pListCtrl; // Window that receives the update notification, usually a CXTShellListCtrl.
|
||||
CWnd* m_pComboBox; // CComboBox that is associated with this control. See AssociateCombo(...)
|
||||
CString m_strTunnelPath; // Current path to tunnel if tree initialization is still pending. Valid if 'm_bTunnelPath' is TRUE.
|
||||
CXTShellSettings m_shSettings; // Contains SHELLFLAGSTATE info.
|
||||
|
||||
// Summary: Enumeration that holds the type of object, folder or drive.
|
||||
enum FindAttribs
|
||||
{
|
||||
type_drive, // The object type is a drive.
|
||||
type_folder // The object type is a folder.
|
||||
};
|
||||
|
||||
// Input: lpsf - Pointer to the parent shell folder.
|
||||
// lpifq - Fully qualified item ID list to the item having items enumerated.
|
||||
// This is the PIDL to the item identified by the 'lpsf' parameter.
|
||||
// hParent - Parent tree node.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function fills a branch of the TreeView control. Given
|
||||
// the shell folder, it enumerates the subitems of this folder, and adds
|
||||
// the appropriate items to the tree.
|
||||
virtual BOOL InitTreeViewItems(LPSHELLFOLDER lpsf,LPITEMIDLIST lpifq,HTREEITEM hParent);
|
||||
|
||||
// Input: lpifq - Fully qualified item ID list for the current item.
|
||||
// lptvitem - Pointer to the tree view item being added to the tree.
|
||||
// Summary: This member function gets the index for the normal and selected
|
||||
// icons for the current item.
|
||||
virtual void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq,LPTV_ITEM lptvitem);
|
||||
|
||||
public:
|
||||
|
||||
// Input: bEnable - TRUE if the tree initializes upon creation.
|
||||
// Summary: Call this member function to enable or disable auto-initialization
|
||||
// of the shell tree control.
|
||||
void EnableAutoInit(BOOL bEnable);
|
||||
|
||||
// Input: bEnable - TRUE to display a context menu.
|
||||
// Summary: Call this member function to enable or disable the display of the
|
||||
// shell context menu on right item click.
|
||||
void EnableContextMenu(BOOL bEnable);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: uFlags - Determines the type of items included in an enumeration. It can
|
||||
// be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>SHCONTF_FOLDERS</b> Include items that are folders in
|
||||
// the enumeration.[/li]
|
||||
// [li]<b>SHCONTF_NONFOLDERS</b> Include items that are not folders
|
||||
// in the enumeration.[/li]
|
||||
// [li]<b>SHCONTF_INCLUDEHIDDEN</b> Include hidden items in the
|
||||
// enumeration.[/li]
|
||||
// [li]<b>SHCONTF_INIT_ON_FIRST_NEXT</b> IShellFolder::EnumObjects
|
||||
// can return without validating the enumeration object. Validation
|
||||
// can be postponed until the first call to IEnumIDList::Next.
|
||||
// This flag is intended to be used when a user interface may be
|
||||
// displayed prior to the first IEnumIDList::Next call. For a
|
||||
// user interface to be presented, 'hwndOwner' must be set to a valid
|
||||
// window handle.[/li]
|
||||
// [li]<b>SHCONTF_NETPRINTERSRCH</b> The caller is looking for
|
||||
// printer objects.[/li]
|
||||
// [/ul]
|
||||
// Summary: Call this member function to determine the type of items included
|
||||
// in the shell enumeration. The default is SHCONTF_FOLDERS | SHCONTF_NONFOLDERS.
|
||||
void SetEnumFlags(UINT uFlags);
|
||||
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function obtains a handle to the system image list and
|
||||
// attaches it to the tree control.
|
||||
virtual BOOL InitSystemImageLists();
|
||||
|
||||
// Summary: This member function adds items to the tree view.
|
||||
virtual void PopulateTreeView();
|
||||
|
||||
// Input: pNMTreeView - Address of an NM_TREEVIEW struct.
|
||||
// Summary: This member function responds to a TVN_ITEMEXPANDING message in
|
||||
// order to fill up subdirectories.
|
||||
virtual void OnFolderExpanding(NM_TREEVIEW* pNMTreeView);
|
||||
|
||||
// Returns: A handle to the currently selected HTREEITEM.
|
||||
// Summary: This member function displays the system popup menu for the selected
|
||||
// item or folder.
|
||||
virtual HTREEITEM GetContextMenu();
|
||||
|
||||
// Input: pNMTreeView - Address of an NM_TREEVIEW struct.
|
||||
// strFolderPath - Address of a CString object to receive the file system path.
|
||||
// Returns: TRUE if the folder path was found, otherwise returns FALSE.
|
||||
// Summary: This member function responds to a TVN_SELCHANGED message to retrieve
|
||||
// the specified folder path.
|
||||
virtual BOOL OnFolderSelected(NM_TREEVIEW* pNMTreeView,CString &strFolderPath);
|
||||
|
||||
// Input: strFolderPath - Address of a CString object to receive the file system path.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function retrieves the path of the currently selected
|
||||
// tree item.
|
||||
virtual BOOL GetSelectedFolderPath(CString &strFolderPath);
|
||||
|
||||
// Input: hItem - Handle to the tree item to search from.
|
||||
// lplvid - Pointer to the list view item data.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function recursively searches the tree control, beginning
|
||||
// at 'hItem', to find the item specified by 'lplvid'. This is typically used when
|
||||
// the user double clicks an item in the list view.
|
||||
virtual BOOL FindTreeItem(HTREEITEM hItem,XT_LVITEMDATA* lplvid);
|
||||
|
||||
// Input: pWnd - Points to the list control that is associated with the tree.
|
||||
// Summary: Call this member function to associate the list control with the tree.
|
||||
virtual void AssociateList(CWnd* pWnd);
|
||||
|
||||
// Input: pWnd - Points to the combo box that is associated with the tree.
|
||||
// Summary: This member function is used to associate a CComboBox object with
|
||||
// the control. Whenever the path changes, the combo is updated.
|
||||
virtual void AssociateCombo(CWnd* pWnd);
|
||||
|
||||
// Input: hItem - Handle to a tree node.
|
||||
// lptvid - Pointer to the list view item data.
|
||||
// Summary: This member function is called to initialize a branch of the shell
|
||||
// tree.
|
||||
virtual void InitTreeNode(HTREEITEM hItem,XT_TVITEMDATA* lptvid);
|
||||
|
||||
// Input: hItem - Tree item to begin the search from.
|
||||
// strSearchName - String to search for.
|
||||
// attr - Looking for folder or drive.
|
||||
// bFindRoot - TRUE to look for the drive letter only.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function searches the tree for a specified folder.
|
||||
virtual BOOL SearchTree(HTREEITEM hItem,CString strSearchName,FindAttribs attr,BOOL bFindRoot=FALSE);
|
||||
|
||||
// Input: strFindPath - Path to find.
|
||||
// Summary: This member function will "tunnel" the tree to find the specified
|
||||
// path. This will only work when the PopulateTreeView() method is used
|
||||
// to populate the tree.
|
||||
virtual void TunnelTree(CString strFindPath);
|
||||
|
||||
// Input: hItem - Tree item to get path for.
|
||||
// strFolderPath - Reference to a CString object to contain the folder path.
|
||||
// Returns: TRUE if the path is not in the file system(e.g.
|
||||
// MyComputer), or if none is selected, it returns FALSE.
|
||||
// Summary: This member function retrieves the path of a folder item, which
|
||||
// does not have to be selected. Pass a CString object that will hold
|
||||
// the folder path.
|
||||
virtual BOOL GetFolderItemPath(HTREEITEM hItem,CString &strFolderPath);
|
||||
|
||||
// Input: lpszPath - Path to populate.
|
||||
// Summary: This member function populates a tree based upon a path.
|
||||
virtual void PopulateTree(LPCTSTR lpszPath);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTShellTreeCtrl)
|
||||
protected:
|
||||
virtual void PreSubclassWindow();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual void OnDragDrop(NM_TREEVIEW* pNMTreeView);
|
||||
|
||||
protected:
|
||||
|
||||
// Input: hItem - Handle to HTREEITEM node.
|
||||
// dwAttributes - Flags retrieved from SHELLFOLDER::GetAttributesOf.
|
||||
// Summary: This member function sets the shell attribute flags for the specified
|
||||
// tree item.
|
||||
void SetAttributes(HTREEITEM hItem,DWORD dwAttributes);
|
||||
|
||||
virtual void DelayContentInit();
|
||||
virtual void ProcessContentInit();
|
||||
virtual HTREEITEM InsertDesktopItem();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTShellTreeCtrl)
|
||||
afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnBeginRDrag(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnUpdateShell(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#define CXTShellTree CXTShellTreeCtrl
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTShellTreeCtrl::SetEnumFlags(UINT uFlags) {
|
||||
m_uFlags = uFlags;
|
||||
}
|
||||
AFX_INLINE void CXTShellTreeCtrl::EnableContextMenu(BOOL bEnable) {
|
||||
m_bContextMenu = bEnable;
|
||||
}
|
||||
AFX_INLINE void CXTShellTreeCtrl::EnableAutoInit(BOOL bEnable) {
|
||||
m_bAutoInit = bEnable;
|
||||
}
|
||||
AFX_INLINE void CXTShellTreeCtrl::AssociateList(CWnd* pWnd) {
|
||||
ASSERT_VALID(pWnd); m_pListCtrl = pWnd;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(__XTSHELLTREECTRL_H__)
|
||||
225
Editor/XT/Include/XTShellTreeView.h
Normal file
225
Editor/XT/Include/XTShellTreeView.h
Normal file
@@ -0,0 +1,225 @@
|
||||
// XTShellTreeView.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __XTSHELLTREEVIEW_H__
|
||||
#define __XTSHELLTREEVIEW_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTShellTreeView is a multiple inheritance class derived from CXTTreeView
|
||||
// and CXTShellPidl. It is used to create a CXTShellTreeView class object.
|
||||
class _XT_EXT_CLASS CXTShellTreeView : public CXTTreeView, public CXTShellPidl
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTShellTreeView)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTShellTreeView object.
|
||||
CXTShellTreeView();
|
||||
|
||||
// Summary: Destroys a CXTShellTreeView object, handles cleanup and de-allocation.
|
||||
virtual ~CXTShellTreeView();
|
||||
|
||||
protected:
|
||||
|
||||
UINT m_uFlags; // Flags indicating which items to include in the enumeration.
|
||||
bool m_bTunneling; // true if tree is currently traversing.
|
||||
BOOL m_bContextMenu; // TRUE to display the shell context menu on right item click.
|
||||
CWnd* m_pComboBox; // CComboBox that is associated with this control. See AssociateCombo(...)
|
||||
CXTShellSettings m_shSettings; // Contains SHELLFLAGSTATE info.
|
||||
|
||||
// Summary: Enumeration that holds the type of object, folder or drive.
|
||||
enum FindAttribs
|
||||
{
|
||||
type_drive, // The object type is a drive.
|
||||
type_folder // The object type is a folder.
|
||||
};
|
||||
|
||||
// Input: lpsf - Pointer to the parent shell folder.
|
||||
// lpifq - Fully qualified item ID list to the item having items enumerated.
|
||||
// This is the PIDL to the item identified by the 'lpsf' parameter.
|
||||
// hParent - Parent tree node.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function fills a branch of the TreeView control. Given
|
||||
// the shell folder, it enumerates the subitems of this folder, and adds
|
||||
// the appropriate items to the tree.
|
||||
virtual BOOL InitTreeViewItems(LPSHELLFOLDER lpsf,LPITEMIDLIST lpifq,HTREEITEM hParent);
|
||||
|
||||
// Input: lpifq - Fully qualified item ID list for the current item.
|
||||
// lptvitem - Pointer to the tree view item being added to the tree.
|
||||
// Summary: This member function gets the index for the normal and selected
|
||||
// icons for the current item.
|
||||
virtual void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq,LPTV_ITEM lptvitem);
|
||||
|
||||
public:
|
||||
|
||||
// Input: bEnable - TRUE to display a context menu.
|
||||
// Summary: Call this member function to enable or disable the display of the
|
||||
// shell context menu on right item click.
|
||||
void EnableContextMenu(BOOL bEnable);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: uFlags - Determines the type of items included in an enumeration. It
|
||||
// can be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>SHCONTF_FOLDERS</b> Include items that are folders in
|
||||
// the enumeration.[/li]
|
||||
// [li]<b>SHCONTF_NONFOLDERS</b> Include items that are not folders
|
||||
// in the enumeration.[/li]
|
||||
// [li]<b>SHCONTF_INCLUDEHIDDEN</b> Include hidden items in the
|
||||
// enumeration.[/li]
|
||||
// [li]<b>SHCONTF_INIT_ON_FIRST_NEXT</b> IShellFolder::EnumObjects
|
||||
// can return without validating the enumeration object. Validation
|
||||
// can be postponed until the first call to IEnumIDList::Next.
|
||||
// This flag is intended to be used when a user interface may be
|
||||
// displayed prior to the first IEnumIDList::Next call. For a
|
||||
// user interface to be presented, 'hwndOwner' must be set to a valid
|
||||
// window handle.[/li]
|
||||
// [li]<b>SHCONTF_NETPRINTERSRCH</b> The caller is looking for
|
||||
// printer objects.[/li]
|
||||
// [/ul]
|
||||
// Summary: Call this member function to determine the type of items included
|
||||
// in the shell enumeration. The default is SHCONTF_FOLDERS | SHCONTF_NONFOLDERS.
|
||||
void SetEnumFlags(UINT uFlags);
|
||||
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function obtains a handle to the system image list and
|
||||
// attaches it to the tree control.
|
||||
virtual BOOL InitSystemImageLists();
|
||||
|
||||
// Summary: This member function adds items to the tree view.
|
||||
virtual void PopulateTreeView();
|
||||
|
||||
// Input: pNMTreeView - Address of an NM_TREEVIEW struct.
|
||||
// Summary: This member function responds to a TVN_ITEMEXPANDING message in
|
||||
// order to fill up subdirectories.
|
||||
virtual void OnFolderExpanding(NM_TREEVIEW* pNMTreeView);
|
||||
|
||||
// Returns: A handle to the currently selected HTREEITEM.
|
||||
// Summary: This member function displays the system popup menu for the selected
|
||||
// item or folder.
|
||||
virtual HTREEITEM GetContextMenu();
|
||||
|
||||
// Input: pNMTreeView - Address of an NM_TREEVIEW struct.
|
||||
// strFolderPath - Address of a CString object to receive the file system path.
|
||||
// Returns: TRUE if the folder path was found, otherwise returns FALSE.
|
||||
// Summary: This member function responds to a TVN_SELCHANGED message to retrieve
|
||||
// the specified folder path.
|
||||
virtual BOOL OnFolderSelected(NM_TREEVIEW* pNMTreeView,CString &strFolderPath);
|
||||
|
||||
// Input: strFolderPath - Address of a CString object to receive the file system path.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function retrieves the path of the currently selected
|
||||
// tree item.
|
||||
virtual BOOL GetSelectedFolderPath(CString &strFolderPath);
|
||||
|
||||
// Input: hItem - Handle to the tree item to search from.
|
||||
// lplvid - Pointer to the list view item data.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function recursively searches the tree control, beginning
|
||||
// at 'hItem', to find the item specified by 'lplvid'. This is typically used when
|
||||
// the user double clicks an item in the list view.
|
||||
virtual BOOL FindTreeItem(HTREEITEM hItem,XT_LVITEMDATA* lplvid);
|
||||
|
||||
// Input: pWnd - Points to the combo box that is associated with the tree.
|
||||
// Summary: This member function is used to associate a CComboBox object with
|
||||
// the control. Whenever the path changes, the combo is updated.
|
||||
virtual void AssociateCombo(CWnd* pWnd);
|
||||
|
||||
// Input: hItem - Handle to a tree node.
|
||||
// lptvid - Pointer to the list view item data.
|
||||
// Summary: This member function is called to initialize a branch of the shell
|
||||
// tree.
|
||||
virtual void InitTreeNode(HTREEITEM hItem,XT_TVITEMDATA* lptvid);
|
||||
|
||||
// Input: hItem - Tree item to begin the search from.
|
||||
// strSearchName - String to search for.
|
||||
// attr - Looking for folder or drive.
|
||||
// bFindRoot - TRUE to look for a drive letter only.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function searches the tree for a specified folder.
|
||||
virtual BOOL SearchTree(HTREEITEM hItem,CString strSearchName,FindAttribs attr,BOOL bFindRoot=FALSE);
|
||||
|
||||
// Input: strFindPath - Path to find.
|
||||
// Summary: This member function will "tunnel" the tree to find the specified
|
||||
// path. This will only work when the PopulateTreeView() method is used
|
||||
// to populate the tree.
|
||||
virtual void TunnelTree(CString strFindPath);
|
||||
|
||||
// Input: hItem - Tree item to get the path for.
|
||||
// strFolderPath - Reference to a CString object to contain the folder path.
|
||||
// Returns: TRUE if the path is not in the file system(e.g.
|
||||
// MyComputer), or if none is selected, it returns FALSE.
|
||||
// Summary: This member function retrieves the path of a folder item, which
|
||||
// does not have to be selected. Pass a CString object that will hold
|
||||
// the folder path.
|
||||
virtual BOOL GetFolderItemPath(HTREEITEM hItem,CString &strFolderPath);
|
||||
|
||||
// Input: lpszPath - Path to populate.
|
||||
// Summary: This member function populates a tree based upon a path.
|
||||
virtual void PopulateTree(LPCTSTR lpszPath);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTShellTreeView)
|
||||
public:
|
||||
virtual void OnInitialUpdate();
|
||||
protected:
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual void OnDragDrop(NM_TREEVIEW* pNMTreeView);
|
||||
virtual HTREEITEM InsertDesktopItem();
|
||||
|
||||
protected:
|
||||
|
||||
// Input: hItem - Handle to HTREEITEM node.
|
||||
// dwAttributes - Flags retrieved from SHELLFOLDER::GetAttributesOf.
|
||||
// Summary: This member function sets the shell attribute flags for the specified
|
||||
// tree item.
|
||||
void SetAttributes(HTREEITEM hItem,DWORD dwAttributes);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTShellTreeView)
|
||||
afx_msg void OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnPaint();
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg void OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnBeginRDrag(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTShellTreeView::SetEnumFlags(UINT uFlags) {
|
||||
m_uFlags = uFlags;
|
||||
}
|
||||
AFX_INLINE void CXTShellTreeView::EnableContextMenu(BOOL bEnable) {
|
||||
m_bContextMenu = bEnable;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // __XTSHELLTREEVIEW_H__
|
||||
152
Editor/XT/Include/XTSkins.h
Normal file
152
Editor/XT/Include/XTSkins.h
Normal file
@@ -0,0 +1,152 @@
|
||||
// XTSkins.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTSKINS_H__)
|
||||
#define __XTSKINS_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
// forwards
|
||||
|
||||
class CXTToolBar;
|
||||
class CXTFlatEdit;
|
||||
class CXTFlatComboBox;
|
||||
class CXTCommandsListBox;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: IXTFlatComboProxy is a stand alone interface class. It is an API for
|
||||
// skin related operations for a flat combo.
|
||||
interface IXTFlatComboProxy
|
||||
{
|
||||
// Input: pCombo - CXTFlatComboBox pointer to the combo to draw.
|
||||
// pDC - CDC pointer to the device context to render on.
|
||||
// bHilight - Flag that tells if the combo must be highlighted.
|
||||
// Summary: This member function renders the appearance of the combo box.
|
||||
virtual void DrawCombo(CXTFlatComboBox* pCombo,CDC* pDC,BOOL bHilight) = 0;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: IXTFlatEditProxy is a stand alone interface class. It is an API for
|
||||
// skin related operations for a flat edit.
|
||||
interface IXTFlatEditProxy
|
||||
{
|
||||
|
||||
// Input: pCombo - CXTFlatEdit pointer to the combo to draw.
|
||||
// pDC - CDC pointer to the device context to render on.
|
||||
// bHilight - Flag that tells if the combo must be highlighted.
|
||||
// Summary: This member function renders the appearance of the combo box.
|
||||
virtual void DrawEdit(CXTFlatEdit* pCombo,CDC* pDC,BOOL bHilight) = 0;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: IXTToolbarProxy is a stand alone interface class. It is used to create
|
||||
// an API for skin related operations for a toolbar item.
|
||||
interface IXTToolbarProxy
|
||||
{
|
||||
|
||||
// Input: pDC - CDC pointer to the device context to draw on.
|
||||
// pOwner - CXTToolBar pointer to a toolbar whose item is being drawn.
|
||||
// nIndex - Index of the item (a button) to draw.
|
||||
// Summary: This member function fills in a rectangle allocated to a toolbar control.
|
||||
virtual void FillControlRect(CDC* pDC,CXTToolBar* pOwner,UINT nIndex) = 0;
|
||||
|
||||
// Input: pDC - CDC pointer to the device context to draw on.
|
||||
// pOwner - CXTToolBar pointer to a toolbar whose item is being drawn.
|
||||
// nIndex - Index of the item (a button) to draw.
|
||||
// Returns: TRUE if the item has been drawn, or returns FALSE otherwise.
|
||||
// Summary: This member function draws a toolbar item.
|
||||
virtual BOOL DrawButton(CDC* pDC,CXTToolBar* pOwner,UINT nIndex) = 0;
|
||||
|
||||
// Input: pDC - CDC pointer to the device context to draw on.
|
||||
// pOwner - CXTToolBar pointer to a toolbar whose item is being drawn.
|
||||
// nIndex - Index of the item (separator) to draw.
|
||||
// Summary: This member function draws a toolbar separator.
|
||||
virtual void DrawSeparator(CDC* pDC,CXTToolBar* pOwner,UINT nIndex) = 0;
|
||||
|
||||
// Input: pDC - CDC pointer to the device context to draw on.
|
||||
// pOwner - CXTToolBar pointer to a toolbar whose item is being drawn.
|
||||
// nIndex - Index of the item (button) to draw.
|
||||
// Summary: This member function draws special effects for a dropped item (shadow).
|
||||
virtual void DrawDroppedEffects(CDC* pDC,CXTToolBar* pOwner,UINT nIndex) = 0;
|
||||
|
||||
// Input: pOwner - CXTToolBar pointer to a toolbar that needs to be refreshed.
|
||||
// nIndex - Index of the item (button) to refresh.
|
||||
// Summary: This member function removes special effects around a selected item.
|
||||
virtual void RemoveDroppedEffects(CXTToolBar* pOwner,UINT nIndex) = 0;
|
||||
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: IXTCommandsListBoxProxy is a stand alone interface class. It is used to create
|
||||
// an API for skin related operations for the commands list box.
|
||||
interface IXTCommandsListBoxProxy
|
||||
{
|
||||
|
||||
// Input: lpDIS - LPDRAWITEMSTRUCT pointer that contains information about the
|
||||
// item being drawn.
|
||||
// pOwner - CXTCommandsListBox pointer to the commands list box whose item
|
||||
// is being drawn.
|
||||
// Summary: This member function draws each item in the commands list box.
|
||||
virtual void OnDrawItem(LPDRAWITEMSTRUCT lpDIS,CXTCommandsListBox* pOwner) = 0;
|
||||
|
||||
// Input: pOwner - CXTCommandsListBox pointer to the commands list box that needs
|
||||
// to be refreshed.
|
||||
// Summary: This member function paints the background and handles default
|
||||
// drawing for the commands list box.
|
||||
virtual void OnPaint(CXTCommandsListBox* pOwner) = 0;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: IXTSkin is a stand alone interface class. It is used to create a skin
|
||||
// for rendering UI elements.
|
||||
interface IXTSkin
|
||||
{
|
||||
|
||||
// Returns: A proxy for drawing a flat edit control.
|
||||
// Summary: This member function is used to get a proxy for drawing a flat edit
|
||||
// control. Implementation can return NULL to indicate default control
|
||||
// behavior shall be used.
|
||||
virtual IXTFlatEditProxy* GetFlatEditProxy() = 0;
|
||||
|
||||
// Returns: A proxy for drawing a flat combo box.
|
||||
// Summary: This member function is used to get a proxy for drawing a flat combo
|
||||
// box. Implementation can return NULL to indicate default control behavior
|
||||
// shall be used.
|
||||
virtual IXTFlatComboProxy* GetFlatComboProxy() = 0;
|
||||
|
||||
// Returns: A proxy for drawing a toolbar button.
|
||||
// Summary: This member function is used to get a proxy for drawing a toolbar
|
||||
// button. Implementation can return NULL to indicate default control
|
||||
// behaviour shall be used.
|
||||
virtual IXTToolbarProxy* GetToolbarProxy() = 0;
|
||||
|
||||
// Returns: A proxy for drawing a commands list box.
|
||||
// Summary: This member function is used to get a proxy for drawing a commands list box
|
||||
// control. Implementation can return NULL to indicate default control
|
||||
// behavior shall be used.
|
||||
virtual IXTCommandsListBoxProxy* GetCommandsListBoxProxy() = 0;
|
||||
|
||||
// Input: bTracking - Flag designating current operation state. TRUE if tracking
|
||||
// toolbar is pending, or FALSE otherwise.
|
||||
// Summary: This member function notifies that a toolbar is currently being
|
||||
// dragged or resized.
|
||||
virtual void NotifyToolbarTracking(BOOL bTracking) = 0;
|
||||
|
||||
// Returns: An IXTSkin pointer.
|
||||
// Summary: This member function is a singleton type instantiation.
|
||||
static _XT_EXT_CLASS IXTSkin* GetInstance();
|
||||
};
|
||||
|
||||
#endif // !defined(__XTSKINS_H__)
|
||||
96
Editor/XT/Include/XTSortClass.h
Normal file
96
Editor/XT/Include/XTSortClass.h
Normal file
@@ -0,0 +1,96 @@
|
||||
// XTSortClass.h interface for the CXTSortClass class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTSORTCLASS_H__)
|
||||
#define __XTSORTCLASS_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_DATA_TYPE - Enumeration used by CXTSortClass for specifying what
|
||||
// type of sorting to perform.
|
||||
typedef enum XT_DATA_TYPE
|
||||
{
|
||||
DT_INT = 1, // Sort type int.
|
||||
DT_STRING, // Sort type string.
|
||||
DT_DATETIME, // Sort type date / time.
|
||||
DT_DEC // Sort type decimal.
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTSortClass is a stand alone class. This class will sort a list control
|
||||
// by a column of text, integer, float or date/time type. It could be
|
||||
// easily extended for other data types. To use this class, instantiate
|
||||
// a CXTSortClass object, passing in a pointer to the list control as
|
||||
// the first argument and the column index as the second argument.
|
||||
//
|
||||
// Example: <pre>CXTSortClass sortClass(pListCtrl, 0);</pre>
|
||||
//
|
||||
// Then call the sort method setting ascending as the first argument either
|
||||
// TRUE or FALSE, and the type of sort to perform in the second argument.
|
||||
//
|
||||
// Example: <pre>sortClass.Sort(TRUE, DT_STRING);</pre>
|
||||
class _XT_EXT_CLASS CXTSortClass
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
// Input: pListCtrl - Pointer to a CListCtrl object.
|
||||
// nCol - Index of the column to be sorted.
|
||||
// Summary: Constructs a CXTSortClass object.
|
||||
CXTSortClass(CListCtrl* pListCtrl,const int nCol);
|
||||
|
||||
// Summary: Destroys a CXTSortClass object, handles cleanup and de-allocation.
|
||||
virtual ~CXTSortClass();
|
||||
|
||||
protected:
|
||||
|
||||
CListCtrl* m_pListCtrl; // Pointer to the CListCtrl object to perform the sort on.
|
||||
|
||||
public:
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: bAsc - true to sort ascending.
|
||||
// eType - The type of sort to perform can be one of the following:
|
||||
// [ul]
|
||||
// [li]<b>DT_INT</b> Sort type int.[/li]
|
||||
// [li]<b>DT_STRING</b> Sort type string.[/li]
|
||||
// [li]<b>DT_DATETIME</b> Sort type date / time.[/li]
|
||||
// [li]<b>DT_DEC</b> Sort type decimal.[/li]
|
||||
// [/ul]
|
||||
// Summary: This member function is called to perform the actual sort procedure.
|
||||
virtual void Sort(bool bAsc,XT_DATA_TYPE eType);
|
||||
|
||||
protected:
|
||||
|
||||
// Input: lParam1 - Specify the item data for the two items being compared.
|
||||
// lParam2 - Specify the item data for the two items being compared.
|
||||
// lParamSort - Specifies the application defined value that is passed to the
|
||||
// comparison function.
|
||||
// Summary: This callback member function is called to compare two data items during
|
||||
// sorting operations. The comparison function must return a negative
|
||||
// value if the first item should precede the second, and a positive value
|
||||
// if the first item should follow the second, or zero if the two items
|
||||
// are equivalent.
|
||||
static int CALLBACK Compare(LPARAM lParam1,LPARAM lParam2,LPARAM lParamSort);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTSORTCLASS_H__)
|
||||
163
Editor/XT/Include/XTSplitterDock.h
Normal file
163
Editor/XT/Include/XTSplitterDock.h
Normal file
@@ -0,0 +1,163 @@
|
||||
// XTSplitterDock.h interface for the CXTSplitterRowDock class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTSPLITTERDOCK_H__)
|
||||
#define __XTSPLITTERDOCK_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
// class forwards.
|
||||
|
||||
class CXTDockBar;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTSplitterDock is a stand alone base class. It is used to create a
|
||||
// CXTSplitterDock class object.
|
||||
class _XT_EXT_CLASS CXTSplitterDock
|
||||
{
|
||||
public:
|
||||
|
||||
// Input: pBar - A pointer to a valid CXTDockBar object.
|
||||
// rcCurrent - A reference to a valid CRect object.
|
||||
// bar - Type of splitter bar, either XT_SPLITTER_VERT or XT_SPLITTER_HORZ.
|
||||
// nPos - Index into a control bar array.
|
||||
// Summary: Constructs a CXTSplitterDock object.
|
||||
CXTSplitterDock(CXTDockBar *pBar,const CRect &rcCurrent,const int nType,const int nPos);
|
||||
|
||||
// Summary: Destroys a CXTSplitterDock object, handles clean up and de-allocation.
|
||||
virtual ~CXTSplitterDock();
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// Current Size and Position
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CRect m_rcCurrent; // Current size of the splitter rect.
|
||||
CRect m_rcTrack; // Current size of the tracking rect.
|
||||
CPoint m_ptCurrent; // Represents the current cursor position.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// Width of the Row
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int m_nStartHeight; // Original height of the splitter.
|
||||
int m_nCurrentHeight; // Current height of the splitter.
|
||||
int m_nMaxHeight; // Maximum height for the splitter.
|
||||
int m_nMinHeight; // Minimum height for the splitter.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// Vertical or Horizontal
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int m_nType; // Type of splitter bar either, XT_SPLITTER_VERT or XT_SPLITTER_HORZ.
|
||||
int m_nControlBar; // Index into a control bar array.
|
||||
CXTDockBar* m_pDockBar; // Pointer to the dockbar.
|
||||
|
||||
// Input: point - Represents the current cursor position.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function is called to move the splitter during tracking
|
||||
// operations.
|
||||
virtual bool Move(CPoint point);
|
||||
|
||||
// Input: point - Represents the current cursor position.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function is called during tracking operations.
|
||||
virtual bool StartTrack(CPoint point);
|
||||
|
||||
// Input: point - Represents the current cursor position.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function is called to terminate the tracking operation.
|
||||
virtual bool EndTrack(CPoint point);
|
||||
|
||||
// Returns: TRUE if the splitter is horizontal, otherwise returns FALSE.
|
||||
// Summary: This member function is called to determine if the splitter is horizontal.
|
||||
BOOL IsHorz();
|
||||
|
||||
// Input: point - A reference to a valid CPoint object.
|
||||
// Returns: TRUE if the cursor position specified by 'point' falls inside of the splitter
|
||||
// area, otherwise returns FALSE.
|
||||
// Summary: This member function is called to determine if the cursor position
|
||||
// is inside of the splitter area.
|
||||
BOOL HitTest(const CPoint &point);
|
||||
|
||||
// Input: nLength - New size for the splitter.
|
||||
// Summary: This member function is called to set the length for the splitter.
|
||||
void SetLength(int nLength);
|
||||
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function is called to display the tracking rect when the
|
||||
// splitter is moved.
|
||||
bool OnInvertTracker();
|
||||
|
||||
// Input: pDC - A CDC pointer to a valid device context.
|
||||
// Summary: This member function is called to draw the splitter during paint operations.
|
||||
void Draw(CDC *pDC);
|
||||
|
||||
protected:
|
||||
|
||||
// Summary: This member function is called internally to set the new height for
|
||||
// the splitter bar based on the current control bar size.
|
||||
virtual void SetNewHeight();
|
||||
|
||||
// Summary: This member function is called internally to calculate the new height
|
||||
// for the splitter bar based on the current control bar size.
|
||||
virtual void CalcMaxMinHeight();
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTSplitterRowDock is a CXTSplitterDock derived class. It is used to
|
||||
// create a CXTSplitterRowDock class object.
|
||||
class _XT_EXT_CLASS CXTSplitterRowDock : public CXTSplitterDock
|
||||
{
|
||||
public:
|
||||
|
||||
// Input: pBar - A pointer to a valid CXTDockBar object.
|
||||
// rcCurrent - A reference to a valid CRect object.
|
||||
// nType - Type of splitter bar, either XT_SPLITTER_VERT or XT_SPLITTER_HORZ.
|
||||
// nPos - Index into a control bar array.
|
||||
// Summary: Constructs a CXTSplitterRowDock object.
|
||||
CXTSplitterRowDock(CXTDockBar *pBar,const CRect &rcCurrent,const int nType,const int nPos);
|
||||
|
||||
// Input: point - Represents the current cursor position.
|
||||
// Returns: true if successful, otherwise returns false.
|
||||
// Summary: This member function is called to move the splitter during tracking
|
||||
// operations.
|
||||
virtual bool Move(CPoint point);
|
||||
|
||||
protected:
|
||||
|
||||
// Summary: This member function is called internally to set the new height for
|
||||
// the splitter bar based on the current control bar size.
|
||||
virtual void SetNewHeight();
|
||||
|
||||
// Summary: This member function is called internally to calculate the new height
|
||||
// for the splitter bar based on the current control bar size.
|
||||
virtual void CalcMaxMinHeight();
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE BOOL CXTSplitterDock::IsHorz() {
|
||||
return (m_nType == XT_SPLITTER_HORZ);
|
||||
}
|
||||
AFX_INLINE BOOL CXTSplitterDock::HitTest(const CPoint &point) {
|
||||
return m_rcCurrent.PtInRect(point);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTSPLITTERDOCK_H__)
|
||||
221
Editor/XT/Include/XTSplitterWnd.h
Normal file
221
Editor/XT/Include/XTSplitterWnd.h
Normal file
@@ -0,0 +1,221 @@
|
||||
// XTSplitterWnd.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTSPLITTERWND_H__)
|
||||
#define __XTSPLITTERWND_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTSplitterWnd is a CSplitterWnd derived class. It adds the ability
|
||||
// to hide and show splitter panes, based upon its index.
|
||||
class _XT_EXT_CLASS CXTSplitterWnd : public CSplitterWnd
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTSplitterWnd)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTSplitterWnd object.
|
||||
CXTSplitterWnd();
|
||||
|
||||
// Summary: Destroys a CXTSplitterWnd object, handles cleanup and de-allocation.
|
||||
virtual ~CXTSplitterWnd();
|
||||
|
||||
protected:
|
||||
|
||||
int m_nHiddenCol; // Index of the hidden column.
|
||||
int m_nHiddenRow; // Index of the hidden row.
|
||||
BOOL m_bFullDrag; // TRUE if full window dragging is enabled.
|
||||
BOOL m_bFlatSplit; // TRUE if the flat splitter style is used.
|
||||
DWORD m_dwxStyle; // The style of the splitter window. See SetSplitterStyle(...).
|
||||
CPoint m_point; // Previous cursor position.
|
||||
|
||||
public:
|
||||
|
||||
// Summary: This member function is called to show the column that was previously
|
||||
// hidden.
|
||||
virtual void ShowColumn();
|
||||
|
||||
// Input: nColHide - Index of the column to hide.
|
||||
// Summary: This member function will hide a column based upon its index.
|
||||
virtual void HideColumn(int nColHide);
|
||||
|
||||
// Summary: This member function is called to show the row that was previously
|
||||
// hidden.
|
||||
virtual void ShowRow();
|
||||
|
||||
// Input: nRowHide - Index of the row to hide.
|
||||
// Summary: This member function will hide a row based upon its index.
|
||||
virtual void HideRow(int nRowHide);
|
||||
|
||||
// Input: nRow - Specifies a row.
|
||||
// nCol - Specifies a column.
|
||||
// pNewView - Specifies the view to switch the specified pane with.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function is called to switch, or swap, a splitter view
|
||||
// with another.
|
||||
virtual BOOL SwitchView(int nRow,int nCol,CView *pNewView);
|
||||
|
||||
// Input: nRow - Specifies a row.
|
||||
// nCol - Specifies a column.
|
||||
// pViewClass - Specifies the runtime class to replace the specified pane with.
|
||||
// Returns: A CView pointer to the view that was replaced, otherwise returns NULL.
|
||||
// Summary: This member function is called to replace an existing splitter view
|
||||
// with another.
|
||||
virtual CView* ReplaceView(int nRow,int nCol,CRuntimeClass *pViewClass);
|
||||
|
||||
// Input: nRow - Specifies a row.
|
||||
// nCol - Specifies a column.
|
||||
// pNewView - Points to an already existing view.
|
||||
// Returns: A CView pointer to the view that was replaced, otherwise returns NULL.
|
||||
// Summary: This member function is called to replace an existing splitter view
|
||||
// with another.
|
||||
virtual CView* ReplaceView(int nRow,int nCol,CView* pNewView);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwxStyle - Specifies XT_SPLIT_ styles to be added during style modification.
|
||||
// The desired styles for the control bar can be one or more of the
|
||||
// following:
|
||||
// [ul]
|
||||
// [li]<b>XT_SPLIT_DOTTRACKER</b> The splitter window will use a
|
||||
// dotted tracker rather than the splitter default.[/li]
|
||||
// [li]<b>XT_SPLIT_NOFULLDRAG</b> Disable the "Show window contents while
|
||||
// dragging" option, even if it is set in Windows.[/li]
|
||||
// [li]<b>XT_SPLIT_NOBORDER</b> The splitter window will not draw a
|
||||
// border around the pane.[/li]
|
||||
// [li]<b>XT_SPLIT_NOSIZE</b> Do not allow splitter window panes to
|
||||
// be resized.[/li]
|
||||
// [/ul]
|
||||
// Summary: Call this member function to modify a splitter window's style. Styles
|
||||
// to be added or removed can be combined by using the bitwise OR (|)
|
||||
// operator.
|
||||
virtual void SetSplitterStyle(DWORD dwxStyle);
|
||||
|
||||
// Returns: The current style of the splitter window.
|
||||
// Summary: Call this member function to return the current style for the splitter
|
||||
// window.
|
||||
// See Also: SetSplitterStyle()
|
||||
virtual DWORD GetSplitterStyle();
|
||||
|
||||
// Input: bFlatSplitter - TRUE to enable flat splitters.
|
||||
// Summary: Call this member function to enable or disable flat splitters.
|
||||
virtual void EnableFlatLook(BOOL bFlatSplitter);
|
||||
|
||||
// Returns: The index of the hidden column or -1 if no columns are hidden.
|
||||
// Summary: Call this member function to return the index of the column that is
|
||||
// currently hidden.
|
||||
int GetHiddenColIndex();
|
||||
|
||||
// Returns: The index of the hidden row or -1 if no rows are hidden.
|
||||
// Summary: Call this member function to return the index of the row that is
|
||||
// currently hidden.
|
||||
int GetHiddenRowIndex();
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTSplitterWnd)
|
||||
protected:
|
||||
virtual void SetSplitCursor(int ht);
|
||||
virtual void OnInvertTracker(const CRect& rect);
|
||||
virtual void StartTracking(int ht);
|
||||
virtual void StopTracking(BOOL bAccept);
|
||||
virtual void DrawTracker(const CRect& rect, CBrush* pBrush);
|
||||
virtual void OnDrawSplitter(CDC* pDC, ESplitType nType, const CRect& rectArg);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTSplitterWnd)
|
||||
afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg UINT OnNcHitTest(CPoint point);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE DWORD CXTSplitterWnd::GetSplitterStyle() {
|
||||
return m_dwxStyle;
|
||||
}
|
||||
AFX_INLINE int CXTSplitterWnd::GetHiddenColIndex() {
|
||||
return m_nHiddenCol;
|
||||
}
|
||||
AFX_INLINE int CXTSplitterWnd::GetHiddenRowIndex() {
|
||||
return m_nHiddenRow;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTSplitterWndEx is a CXTSplitterWnd derived class. It can be used
|
||||
// with the CXTOutBarCtrl to display a gap between the top of the splitter
|
||||
// and the toolbar area.
|
||||
class _XT_EXT_CLASS CXTSplitterWndEx : public CXTSplitterWnd
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTSplitterWndEx)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTSplitterWndEx object.
|
||||
CXTSplitterWndEx();
|
||||
|
||||
// Summary: Destroys a CXTSplitterWndEx object, handles cleanup and de-allocation.
|
||||
virtual ~CXTSplitterWndEx();
|
||||
|
||||
protected:
|
||||
|
||||
int m_cyTopBorderGap; // Size, in pixels, of the top border.
|
||||
bool m_bShowTopBorder; // true to draw a top border line.
|
||||
|
||||
public:
|
||||
|
||||
// Input: bShowTopBorder - If TRUE, a white edge will be drawn along the top.
|
||||
// cyTopBorderGap - Amount, in pixels, to offset the splitter edge.
|
||||
// Summary: Call this member function to show a top border for the splitter
|
||||
// window, similar to Outlook. Enabled by default.
|
||||
virtual void ShowTopBorder(bool bShowTopBorder=true,int cyTopBorderGap=7);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTSplitterWndEx)
|
||||
//}}AFX_VIRTUAL
|
||||
protected:
|
||||
virtual void GetInsideRect(CRect& rect) const;
|
||||
public:
|
||||
virtual void RecalcLayout();
|
||||
virtual void OnDrawSplitter(CDC* pDC, ESplitType nType, const CRect& rectArg);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTSplitterWndEx)
|
||||
afx_msg void OnPaint();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTSplitterWndEx::ShowTopBorder(bool bShowTopBorder, int cyTopBorderGap) {
|
||||
m_bShowTopBorder = bShowTopBorder; m_cyTopBorderGap = cyTopBorderGap;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(__XTSPLITTERWND_H__)
|
||||
151
Editor/XT/Include/XTStatusBar.h
Normal file
151
Editor/XT/Include/XTStatusBar.h
Normal file
@@ -0,0 +1,151 @@
|
||||
// XTStatusBar.h : header file
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __XTSTATUSBAR_H__
|
||||
#define __XTSTATUSBAR_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_STATUSPANE is a stand alone structure class. It is used to create
|
||||
// an XT_STATUSPANE structure.
|
||||
struct XT_STATUSPANE
|
||||
{
|
||||
UINT nID; // IDC of indicator: 0 => normal text area.
|
||||
int cxText; // Width of the string area, in pixels. On both sides there is a 3 pixel gap and a 1 pixel border, making a pane 6 pixels wider.
|
||||
UINT nStyle; // Style flags (SBPS_*).
|
||||
UINT nFlags; // State flags (SBPF_*).
|
||||
CString strText; // Text in the pane.
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: XT_STATUSPANE_CTRL is a stand alone helper structure class. It is used
|
||||
// by the CXTStatusBar class.
|
||||
struct XT_STATUSPANE_CTRL
|
||||
{
|
||||
CWnd* pWnd; // A pointer to a valid CWnd object.
|
||||
UINT nID; // ID of the indicator pane.
|
||||
BOOL bAutoDelete; // TRUE if the control is to be deleted when destroyed.
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTStatusBar is a CStatusBar derived class. It allows you to easily
|
||||
// insert controls into your status bar, and remove controls from your
|
||||
// status bar.
|
||||
class _XT_EXT_CLASS CXTStatusBar : public CStatusBar
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTStatusBar)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTStatusBar object.
|
||||
CXTStatusBar();
|
||||
|
||||
// Summary: Destroys a CXTStatusBar object, handles cleanup and de-allocation.
|
||||
virtual ~CXTStatusBar();
|
||||
|
||||
// Attributes
|
||||
protected:
|
||||
|
||||
CArray <XT_STATUSPANE_CTRL*,XT_STATUSPANE_CTRL*> m_arControls; // Array of pane controls.
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Summary: This member function is called by the status bar to reposition pane
|
||||
// item controls.
|
||||
void PositionControls();
|
||||
|
||||
// Input: nID - ID of the indicator pane.
|
||||
// Returns: A pointer to an XT_STATUSPANE_CTRL struct.
|
||||
// Summary: Call this member function to retrieve information for the specified
|
||||
// indicator pane.
|
||||
XT_STATUSPANE_CTRL* GetPaneControl(UINT nID);
|
||||
|
||||
// Input: pWnd - Points to a control window.
|
||||
// nID - ID of the indicator pane.
|
||||
// bAutoDelete - TRUE if the control is to be deleted when destroyed.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to add a control to an indicator pane.
|
||||
BOOL AddControl(CWnd* pWnd,UINT nID,BOOL bAutoDelete=TRUE);
|
||||
|
||||
// Input: nIndex - Index of the indicator pane.
|
||||
// cxText - New width for the indicator pane.
|
||||
// Summary: Call this member function to set the width for an indicator pane.
|
||||
void SetPaneWidth(int nIndex,int cxText);
|
||||
|
||||
// Input: nID - ID of the indicator pane.
|
||||
// nIndex - Index of the indicator pane.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to add an indicator pane to the status bar.
|
||||
BOOL AddIndicator(UINT nID,int nIndex);
|
||||
|
||||
// Input: nID - ID of the indicator pane.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to remove an indicator pane from the status bar.
|
||||
BOOL RemoveIndicator(UINT nID);
|
||||
|
||||
// Input: nIndex - Index of the indicator pane.
|
||||
// pSBP - Address of an XT_STATUSPANE struct.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to retrieve information for an indicator pane.
|
||||
BOOL GetPaneInfoEx(int nIndex,XT_STATUSPANE* pSBP);
|
||||
|
||||
// Input: nIndex - Index of the indicator pane.
|
||||
// pSBP - Address of an XT_STATUSPANE struct.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to set the information for an indicator pane.
|
||||
BOOL SetPaneInfoEx(int nIndex,XT_STATUSPANE* pSBP);
|
||||
|
||||
// Input: nIndex - Index of the indicator pane.
|
||||
// Returns: A pointer to an XT_STATUSPANE struct.
|
||||
// Summary: Call this member function to get the pane information for the given index.
|
||||
XT_STATUSPANE* GetPanePtr(int nIndex) const;
|
||||
|
||||
// Returns: An integer value that represents the number of panes for the status bar.
|
||||
// Summary: Call this member function to return the number of panes that are created
|
||||
// for the status bar.
|
||||
int GetPaneCount() const;
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTStatusBar)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTStatusBar)
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg LRESULT OnIdleUpdateCmdUI (WPARAM wParam, LPARAM lParam);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE int CXTStatusBar::GetPaneCount() const {
|
||||
return m_nCount;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // __XTSTATUSBAR_H__
|
||||
562
Editor/XT/Include/XTTabCtrl.h
Normal file
562
Editor/XT/Include/XTTabCtrl.h
Normal file
@@ -0,0 +1,562 @@
|
||||
// XTTabCtrl.h interface for the CXTTabCtrl class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTTABCTRL_H__)
|
||||
#define __XTTABCTRL_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#define MESSAGE_MAP_ENTRIES_CXTTabCtrlBase \
|
||||
ON_WM_PAINT() \
|
||||
ON_WM_ERASEBKGND() \
|
||||
ON_WM_SETTINGCHANGE() \
|
||||
ON_WM_SYSCOLORCHANGE()
|
||||
|
||||
#define MESSAGE_MAP_ENTRIES_CXTTabCtrlBaseEx \
|
||||
MESSAGE_MAP_ENTRIES_CXTTabCtrlBase \
|
||||
ON_WM_RBUTTONDOWN() \
|
||||
ON_WM_CREATE() \
|
||||
ON_WM_DESTROY() \
|
||||
ON_NOTIFY_REFLECT(TCN_SELCHANGE, OnSelchange) \
|
||||
ON_NOTIFY_REFLECT(TCN_SELCHANGING, OnSelchanging) \
|
||||
ON_WM_WINDOWPOSCHANGED() \
|
||||
ON_MESSAGE(XTWM_INITIAL_UPDATE, OnInitialize) \
|
||||
ON_MESSAGE_VOID(WM_INITIALUPDATE, OnInitialUpdate)
|
||||
|
||||
class CXTTabCtrlButtons;
|
||||
|
||||
// Summary: XT_NAVBTNFLAGS is an enumeration used by CXTTabCtrl to determine navigation button style.
|
||||
enum XT_NAVBTNFLAGS
|
||||
{
|
||||
XT_SHOW_ARROWS = 1, // To show arrow buttons.
|
||||
XT_SHOW_CLOSE = 2, // To show close button.
|
||||
XT_SHOW_ALL = 3 // To show arrow and close buttons.
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTTabCtrlBase is a stand alone base class. It is used to draw an XP
|
||||
// style tab control.
|
||||
class _XT_EXT_CLASS CXTTabCtrlBase
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTTabCtrlBase object.
|
||||
CXTTabCtrlBase();
|
||||
|
||||
// Summary: Destroys a CXTTabCtrlBase object, handles cleanup and de-allocation.
|
||||
virtual ~CXTTabCtrlBase();
|
||||
|
||||
protected:
|
||||
|
||||
int m_iEdge; // System metrics for SM_CYEDGE (XP only).
|
||||
CPen m_penBlack; // Black pen (XP only).
|
||||
CPen m_penWhite; // White pen (XP only).
|
||||
CPen m_penFace; // 3D face pen (XP only).
|
||||
CPen m_penText; // Non-selected text pen (XP only).
|
||||
CTabCtrl* m_pTabCtrl; // Pointer to the tab control associated with this object.
|
||||
|
||||
// Input: pTabCtrl - Points to a valid tab control object.
|
||||
// Summary: Call this member function to associate the tab control with this object.
|
||||
void ImplAttach(CTabCtrl *pTabCtrl);
|
||||
|
||||
public:
|
||||
|
||||
bool m_bBoldFont; // true to set the selected tab font to bold.
|
||||
bool m_bXPBorder; // true to draw an XP border around the tab child window.
|
||||
bool m_bDisableXPMode; // true to override system defaults and disable XP look for this control.
|
||||
BOOL m_bAutoCondensing; // TRUE for auto-condensing tabs.
|
||||
|
||||
public:
|
||||
|
||||
// Input: rcChild - A reference to a CRect object to receive the client coordinates.
|
||||
// Summary: This member function copies the child coordinates of the CTabCtrl client
|
||||
// area into the object referenced by 'rcChild'. The client coordinates
|
||||
// specify the upper-left and lower-right corners of the client area.
|
||||
virtual void GetChildRect(CRect& rcChild) const;
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: dwFlags - The value can be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>XT_SHOW_ARROWS</b> To show arrow buttons.[/li]
|
||||
// [li]<b>XT_SHOW_CLOSE</b> To show close button.[/li]
|
||||
// [li]<b>XT_SHOW_ALL</b> To show arrow and close buttons.[/li]
|
||||
// [/ul]
|
||||
// Summary: Call this member function to set visibility of the navigation buttons. These
|
||||
// buttons are used inplace of the default forward and back buttons that are
|
||||
// displayed when the tab control is not wide enough to display all tabs. You can
|
||||
// also define a close button to be used to close the active tab. This will give
|
||||
// the tab control a VS.NET style tabbed interface.
|
||||
void ShowNavButtons(DWORD dwFlags);
|
||||
|
||||
protected:
|
||||
|
||||
// Input: pDC - Points to the client device context.
|
||||
// rcClient - Size of the client area to paint.
|
||||
// rcItem - Size of the selected tab item.
|
||||
// Summary: This member function is called by the tab control to draw top aligned
|
||||
// XP style tabs.
|
||||
virtual void OnDrawTop(CDC* pDC,CRect rcClient,CRect rcItem);
|
||||
|
||||
// Input: pDC - Points to the client device context.
|
||||
// rcClient - Size of the client area to paint.
|
||||
// rcItem - Size of the selected tab item.
|
||||
// Summary: This member function is called by the tab control to draw bottom aligned
|
||||
// XP style tabs.
|
||||
virtual void OnDrawBottom(CDC* pDC,CRect rcClient,CRect rcItem);
|
||||
|
||||
// Input: pDC - Points to the client device context.
|
||||
// rcClient - Size of the client area to paint.
|
||||
// rcItem - Size of the selected tab item.
|
||||
// Summary: This member function is called by the tab control to draw left aligned
|
||||
// XP style tabs.
|
||||
virtual void OnDrawLeft(CDC* pDC,CRect rcClient,CRect rcItem);
|
||||
|
||||
// Input: pDC - Points to the client device context.
|
||||
// rcClient - Size of the client area to paint.
|
||||
// rcItem - Size of the selected tab item.
|
||||
// Summary: This member function is called by the tab control to draw right aligned
|
||||
// XP style tabs.
|
||||
virtual void OnDrawRight(CDC* pDC,CRect rcClient,CRect rcItem);
|
||||
|
||||
// Input: strLabelText - Tab label to add padding to.
|
||||
// Summary: This member function is called by the tab control to add padding to a
|
||||
// tab label for use with XP style tabs.
|
||||
virtual void OnAddPadding(CXTString& strLabelText);
|
||||
|
||||
BOOL OnEraseBkgndImpl(CDC* pDC);
|
||||
void OnPaintImpl();
|
||||
void OnSettingChangeImpl_Post(UINT uFlags, LPCTSTR lpszSection);
|
||||
void OnSysColorChangeImpl_Post();
|
||||
void PaintButtons();
|
||||
CXTTabCtrlButtons* m_pNavBtns;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTTabCtrlBaseEx is a CXTTabCtrlBase derived class. It is used to create
|
||||
// a CXTTabCtrlBaseEx class object.
|
||||
class _XT_EXT_CLASS CXTTabCtrlBaseEx : public CXTTabCtrlBase
|
||||
{
|
||||
protected:
|
||||
|
||||
int m_nPos; // Index of the popup menu contained in the menu.
|
||||
UINT m_popupMenuID; // Popup menu resource ID.
|
||||
BOOL m_bInitialUpdate; // TRUE to send initial update to views when created.
|
||||
CWnd* m_pParentWnd; // Points to the parent and will equal 'm_pParentFrame' in non-dialog applications.
|
||||
CView* m_pLastActiveView; // Points to the last active view that belongs to the main frame window.
|
||||
CFrameWnd* m_pParentFrame; // Points to the parent frame.
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int m_nOldIndex;
|
||||
BOOL m_bInitialUpdatePending;
|
||||
DWORD m_dwInitSignature;
|
||||
|
||||
public:
|
||||
|
||||
CList <XT_TCB_ITEM*, XT_TCB_ITEM*> m_tcbItems; // Template list containing tab information.
|
||||
|
||||
// Summary: Constructs a CXTTabCtrlBase object.
|
||||
CXTTabCtrlBaseEx();
|
||||
|
||||
// Summary: Destroys a CXTTabCtrlBase object, handles cleanup and de-allocation.
|
||||
virtual ~CXTTabCtrlBaseEx();
|
||||
|
||||
// Summary: This member function is called to initialize the font for the tab control
|
||||
// associated with this view.
|
||||
virtual void InitializeFont();
|
||||
|
||||
// Returns: The handle of the tooltip control if successful, otherwise returns NULL.
|
||||
// Summary: This member function retrieves the handle of the tooltip control associated
|
||||
// with the tab control. The tab control creates a tooltip control if
|
||||
// it has the TCS_TOOLTIPS style. You can also assign a tooltip control
|
||||
// to a tab control by using the SetToolTips member function.
|
||||
virtual CToolTipCtrl* GetTips();
|
||||
|
||||
// Input: pWndTip - Pointer to a tooltip control.
|
||||
// Summary: Call this function to assign a tooltip control to the tab control.
|
||||
// You can associate the tooltip control with a tab control by making
|
||||
// a call to GetToolTips.
|
||||
virtual void SetTips(CToolTipCtrl* pWndTip);
|
||||
|
||||
// Input: nIDTab - Index of the tab.
|
||||
// lpszText - Pointer to the text for the tool.
|
||||
// Summary: Call this function to register a tab with the tooltip control, so
|
||||
// that the information stored in the tooltip is displayed when the cursor
|
||||
// is on the tab.
|
||||
virtual void AddToolTip(UINT nIDTab,LPCTSTR lpszText);
|
||||
|
||||
// Input: nIDTab - Index of the tab.
|
||||
// lpszText - Pointer to the text for the tool.
|
||||
// Summary: Call this function to update the tooltip text for the specified tab.
|
||||
virtual void UpdateToolTip(int nIDTab,LPCTSTR lpszText);
|
||||
|
||||
// Input: pViewClass - CRuntimeClass associated with the tab.
|
||||
// lpszText - Pointer to the text for the tool.
|
||||
// Summary: Call this function to update the tooltip text for the specified tab.
|
||||
virtual void UpdateToolTip(CRuntimeClass *pViewClass,LPCTSTR lpszText);
|
||||
|
||||
// Summary: This member function is called to reset the values for the tooltip
|
||||
// control based upon the information stored for each tab.
|
||||
virtual void ResetToolTips();
|
||||
|
||||
// Input: bEnable - TRUE to enable tooltip usage.
|
||||
// Returns: TRUE if the tooltip control was found and updated, otherwise returns
|
||||
// FALSE.
|
||||
// Summary: Call this member function to enable or disable tooltip usage.
|
||||
virtual BOOL EnableToolTipsImpl(BOOL bEnable);
|
||||
|
||||
// Input: lpszLabel - Pointer to the text for the tab associated with the view.
|
||||
// pViewClass - CView runtime class associated with the tab.
|
||||
// pDoc - CDocument associated with the view.
|
||||
// pContext - Create context for the view.
|
||||
// iIndex - -1 to add to the end.
|
||||
// iIconIndex - Icon index for the tab. If -1, 'iIndex' is used to determine the index.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to add a view to the tab control associated
|
||||
// with this view.
|
||||
virtual BOOL AddView(LPCTSTR lpszLabel,CRuntimeClass *pViewClass,CDocument* pDoc=NULL,CCreateContext* pContext=NULL,int iIndex=-1,int iIconIndex=-1);
|
||||
|
||||
// Input: lpszLabel - Pointer to the text for the tab associated with the view.
|
||||
// pView - An existing view to be added to the tab control.
|
||||
// iIndex - -1 to add to the end.
|
||||
// iIconIndex - Icon index for the tab. If -1, nIndex is used to determine the index.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to add a view to the tab control associated
|
||||
// with this view.
|
||||
virtual BOOL AddView(LPCTSTR lpszLabel,CView* pView,int iIndex=-1,int iIconIndex=-1);
|
||||
|
||||
// Input: lpszLabel - Pointer to the text for the tab associated with the view.
|
||||
// pWnd - CWnd object associated with the tab.
|
||||
// iIndex - Tab index of where to insert the new view. Default is -1 to add to
|
||||
// the end.
|
||||
// iIconIndex - Icon index for the tab. If -1, 'iIndex' is used to determine the index.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function is called to add a control to the tab control
|
||||
// associated with this view.
|
||||
virtual BOOL AddControl(LPCTSTR lpszLabel,CWnd* pWnd,int iIndex=-1,int iIconIndex=-1);
|
||||
|
||||
// Input: pViewClass - CView runtime class associated with the tab.
|
||||
// Returns: A pointer to a CView object, otherwise returns NULL.
|
||||
// Summary: This member function returns a pointer to a view from the specified
|
||||
// runtime class.
|
||||
virtual CWnd* GetView(CRuntimeClass *pViewClass);
|
||||
|
||||
// Input: nView - Tab index.
|
||||
// Returns: A pointer to a CView object, otherwise returns NULL.
|
||||
// Summary: This member function returns a pointer to a view from the specified
|
||||
// runtime class.
|
||||
virtual CWnd* GetView(int nView);
|
||||
|
||||
// Returns: A pointer to the active view, otherwise returns NULL.
|
||||
// Summary: This member function returns a pointer to the active view associated
|
||||
// with the selected tab.
|
||||
virtual CWnd* GetActiveView();
|
||||
|
||||
// Input: pTabView - CWnd object to make active.
|
||||
// Summary: This member function is called to activate the specified view and deactivate
|
||||
// all remaining views.
|
||||
virtual void ActivateView(CWnd* pTabView);
|
||||
|
||||
// Input: pViewClass - CView runtime class associated with the tab.
|
||||
// Summary: This member function will set a view active based on the specified
|
||||
// runtime class.
|
||||
virtual void SetActiveView(CRuntimeClass *pViewClass);
|
||||
|
||||
// Input: pTabView - CWnd object to make active.
|
||||
// Summary: This member function will set a view active based on the specified
|
||||
// runtime class.
|
||||
virtual void SetActiveView(CWnd* pTabView);
|
||||
|
||||
// Input: nActiveTab - Tab index.
|
||||
// Summary: This member function will set a view active based on the specified
|
||||
// tab index.
|
||||
virtual void SetActiveView(int nActiveTab);
|
||||
|
||||
// Input: nView - Tab index of the view.
|
||||
// bDestroyWnd - TRUE to destroy the list item.
|
||||
// Summary: This member function will remove a view based on the specified
|
||||
// tab index.
|
||||
virtual void DeleteView(int nView,BOOL bDestroyWnd=TRUE);
|
||||
|
||||
// Input: pView - Points to the CWnd object associated with the tab.
|
||||
// bDestroyWnd - TRUE to destroy the list item.
|
||||
// Summary: This member function will remove a view based on the specified CWnd
|
||||
// pointer associated with the tab.
|
||||
virtual void DeleteView(CWnd* pView,BOOL bDestroyWnd=TRUE);
|
||||
|
||||
// Input: pViewClass - CView runtime class associated with the tab.
|
||||
// bDestroyWnd - TRUE to destroy the list item.
|
||||
// Summary: This member function will remove a view based on the specified CView
|
||||
// runtime class associated with the tab.
|
||||
virtual void DeleteView(CRuntimeClass *pViewClass,BOOL bDestroyWnd=TRUE);
|
||||
|
||||
// Input: nView - Tab index of the view.
|
||||
// Returns: A NULL terminated string that represents the tab item text.
|
||||
// Summary: This member function will return the name for a view based on the tab
|
||||
// index.
|
||||
virtual LPCTSTR GetViewName(int nView);
|
||||
|
||||
// Input: pViewClass - CView runtime class associated with the tab.
|
||||
// Returns: A NULL terminated string that represents the tab item text.
|
||||
// Summary: This member function will return the name for a view based on the tab
|
||||
// index.
|
||||
virtual LPCTSTR GetViewName(CRuntimeClass *pViewClass);
|
||||
|
||||
// Input: pView - A pointer to a CWnd object to be resized.
|
||||
// Summary: Call this member function to resize the tab view specified by 'pView'.
|
||||
virtual void ResizeTabView(CWnd* pView);
|
||||
|
||||
// Input: pos - The POSITION value of the item to be removed.
|
||||
// bDestroyWnd - TRUE to destroy the list item.
|
||||
// Summary: This member function is used by the tab control bar to remove an item
|
||||
// from the tab view list.
|
||||
virtual void RemoveListItem(POSITION pos,BOOL bDestroyWnd=TRUE);
|
||||
|
||||
// Input: bDestroyWnd - TRUE to destroy the window associated with the tab item.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to remove all the tabs, including all associated
|
||||
// views.
|
||||
virtual BOOL RemoveAllTabs(BOOL bDestroyWnd=TRUE);
|
||||
|
||||
// Input: point - Pointer to a CPoint object that contains the cursor screen coordinates.
|
||||
// Use default for current cursor position.
|
||||
// Returns: An integer based index of the tab, or <20>1, if no tab is at the specified 'point'.
|
||||
// Summary: Call this member function to retrieve the tab index from the current cursor
|
||||
// position.
|
||||
virtual int GetTabFromPoint(CPoint point);
|
||||
|
||||
// Input: pView - A pointer to a CWnd object.
|
||||
// Returns: TRUE if the specified CWnd object is a child of the tab control, otherwise
|
||||
// returns FALSE.
|
||||
// Summary: Call this member function to see if the specified CWnd object is a
|
||||
// child of the tab control.
|
||||
virtual BOOL IsChildView(CWnd* pView);
|
||||
|
||||
// Input: nTab - Index of the tab.
|
||||
// lpszLabel - New text for the tab label.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to set the text for the specified tab.
|
||||
BOOL SetTabText(int nTab,LPCTSTR lpszLabel);
|
||||
|
||||
// Input: pView - CWnd object associated with the tab.
|
||||
// lpszLabel - New text for the tab label.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to set the text for the specified tab.
|
||||
BOOL SetTabText(CWnd* pView,LPCTSTR lpszLabel);
|
||||
|
||||
// Input: pViewClass - CRuntimeClass of the CWnd associated with the tab.
|
||||
// lpszLabel - New text for the tab label.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to set the text for the specified tab.
|
||||
BOOL SetTabText(CRuntimeClass *pViewClass,LPCTSTR lpszLabel);
|
||||
|
||||
// Returns: A CWnd pointer to the newly activated view.
|
||||
// Summary: This member function is called to activate the next view in the tab
|
||||
// control.
|
||||
CWnd* NextView();
|
||||
|
||||
// Returns: A CWnd pointer to the newly activated view.
|
||||
// Summary: This member function is called to activate the previous view in the
|
||||
// tab control.
|
||||
CWnd* PrevView();
|
||||
|
||||
// Input: bEnable - TRUE to enable auto-condense mode.
|
||||
// Summary: Call this member function to enable or disable the tab auto-condensing
|
||||
// mode. Auto-condensing mode affects the tab control's behavior when
|
||||
// there is not enough room to fit all tabs. Without auto-condensation,
|
||||
// the CXTTabCtrl control behaves like a standard tab control (i.e. it
|
||||
// will display a slider control that allows the user to pan between tabs).
|
||||
// With the auto-condensing mode enabled, CXTTabCtrl attempts to fit all
|
||||
// tabs in the available space by trimming the tab label text. This behavior
|
||||
// is similar to the behavior displayed by Visual C++'s Workspace View.
|
||||
// For instance, you can see the FileView tab shrink if you shrink the
|
||||
// Workspace View.
|
||||
void SetAutoCondense(BOOL bEnable);
|
||||
|
||||
// Returns: TRUE if auto-condense is enabled, or FALSE if it is disabled.
|
||||
// Summary: This member function returns the state of the tab control's auto-condense
|
||||
// mode. See SetAutoCondense() for a full explanation of this mode.
|
||||
BOOL GetAutoCondense();
|
||||
|
||||
// Input: dwRemove - Specifies window styles to be removed during style modification.
|
||||
// dwAdd - Specifies window styles to be added during style modification.
|
||||
// nFlags - Flags to be passed to SetWindowPos, or zero if SetWindowPos should
|
||||
// not be called. The default is zero. See CWnd::ModifyStyle for more
|
||||
// details.
|
||||
// Returns: Nonzero if the style was successfully modified, otherwise returns zero.
|
||||
// Summary: This member function will modify the style for the tab control associated
|
||||
// with this view and set the appropriate font depending on the tab's
|
||||
// orientation.
|
||||
virtual BOOL ModifyTabStyle(DWORD dwRemove,DWORD dwAdd,UINT nFlags=0);
|
||||
|
||||
// Returns: A CView pointer to the last known view.
|
||||
// Summary: This member function is used to get the last known view that belongs
|
||||
// to the frame.
|
||||
CView* GetLastKnownChildView();
|
||||
|
||||
// Input: popupMenuID - ID for the tab control popup menu.
|
||||
// nPos - Index position in the menu resource.
|
||||
// Summary: This member function is used to set the resource ID for the popup menu
|
||||
// used by the tab control.
|
||||
virtual void SetMenuID(UINT popupMenuID,int nPos=0);
|
||||
|
||||
// Returns: The resource ID of the menu associated with the tab control.
|
||||
// Summary: This member function returns the menu resource associated with the
|
||||
// tab control.
|
||||
virtual UINT GetMenuID();
|
||||
|
||||
// Input: bInitialUpdate - TRUE to send initial update message.
|
||||
// Summary: Call this member function to allow WM_INITIALUPATE message to be sent
|
||||
// to views after creation.
|
||||
virtual void SendInitialUpdate(BOOL bInitialUpdate);
|
||||
|
||||
protected:
|
||||
|
||||
// Summary: This member function is a virtual method that is called to handle a
|
||||
// TCN_SELCHANGING event. Override in your derived class to add additional
|
||||
// functionality.
|
||||
virtual void OnSelChanging();
|
||||
|
||||
// Summary: This member function is a virtual method that is called to handle a
|
||||
// TCN_SELCHANGE event. Override in your derived class to add additional
|
||||
// functionality.
|
||||
virtual void OnSelChange();
|
||||
|
||||
// Input: nTab - Index of the tab.
|
||||
// pMember - Address of an XT_TCB_ITEM struct associated with the tab.
|
||||
// lpszLabel - NULL terminated string that represents the new tab label.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function is called to set the tooltip and tab text for
|
||||
// the specified tab.
|
||||
BOOL UpdateTabLabel(int nTab,XT_TCB_ITEM* pMember,LPCTSTR lpszLabel);
|
||||
|
||||
// Input: pViewClass - CView runtime class to be created.
|
||||
// pDocument - CDocument associated with view.
|
||||
// pContext - Create context for the view.
|
||||
// Returns: A pointer to the newly created CWnd object, otherwise returns NULL.
|
||||
// Summary: This member function creates the CWnd object that is associated
|
||||
// with a tab control item.
|
||||
virtual CWnd* CreateTabView(CRuntimeClass *pViewClass,CDocument *pDocument,CCreateContext *pContext);
|
||||
|
||||
// Input: pDC - Points to the current device context.
|
||||
// sLabel - Represents the tab label text.
|
||||
// bHasIcon - Set to true if the tab item has an icon.
|
||||
// Returns: An integer value that represents the width of a tab.
|
||||
// Summary: This member function is used internally by the tab control to calculate
|
||||
// the width of a tab based on its label text.
|
||||
int CalculateTabWidth(CDC *pDC,CString& sLabel,bool bHasIcon);
|
||||
|
||||
// Summary: This member function is used internally by the tab control to shrink,
|
||||
// or unshrink, tabs based on the control's width and the state of the
|
||||
// auto-condensation mode. See SetAutoCondense() for more information.
|
||||
void Condense();
|
||||
|
||||
void OnRButtonDownImpl(UINT nFlags, CPoint point);
|
||||
int OnCreateImpl_Post(LPCREATESTRUCT lpCreateStruct);
|
||||
void OnDestroyImpl_Pre();
|
||||
void OnSelchangeImpl(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
void OnSelchangingImpl(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
void OnWindowPosChangedImpl_Pre(WINDOWPOS FAR* lpwndpos);
|
||||
void OnWindowPosChangedImpl_Post(WINDOWPOS FAR* lpwndpos);
|
||||
BOOL PreTranslateMessageImpl(MSG* pMsg);
|
||||
void PreSubclassWindowImpl_Post();
|
||||
BOOL OnCmdMsgImpl_Pre(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
|
||||
LRESULT OnInitializeImpl(WPARAM, LPARAM);
|
||||
void OnInitialUpdateImpl();
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTTabCtrl is a multiple inheritance class derived from CTabCtrl and
|
||||
// CXTTabCtrlBaseEx. It is used to create a CXTTabCtrl class object. See
|
||||
// CXTTabCtrlBaseEx for additional functionality.
|
||||
class _XT_EXT_CLASS CXTTabCtrl : public CTabCtrl, public CXTTabCtrlBaseEx
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTTabCtrl)
|
||||
|
||||
friend class CXTTabCtrlBase;
|
||||
friend class CXTTabCtrlBaseEx;
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTTabCtrl object.
|
||||
CXTTabCtrl();
|
||||
|
||||
// Summary: Destroys a CXTTabCtrl object, handles cleanup and de-allocation.
|
||||
virtual ~CXTTabCtrl();
|
||||
|
||||
protected:
|
||||
|
||||
public:
|
||||
|
||||
// Input: bEnable - TRUE to enable tooltip usage.
|
||||
// Returns: TRUE if the tooltip control was found and updated, otherwise returns FALSE.
|
||||
// Summary: Call this member function to enable or disable tooltip usage.
|
||||
virtual BOOL EnableToolTips(BOOL bEnable);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTTabCtrl)
|
||||
public:
|
||||
virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
protected:
|
||||
virtual void PreSubclassWindow();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTTabCtrl)
|
||||
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnSelchange(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnSelchanging(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
|
||||
afx_msg void OnSysColorChange();
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnInitialize(WPARAM wp, LPARAM lp) { return OnInitializeImpl(wp, lp); };
|
||||
afx_msg void OnInitialUpdate() {OnInitialUpdateImpl(); }
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE UINT CXTTabCtrlBaseEx::GetMenuID() {
|
||||
ASSERT(::IsWindow(m_pTabCtrl->GetSafeHwnd())); return m_popupMenuID;
|
||||
}
|
||||
AFX_INLINE CWnd* CXTTabCtrlBaseEx::GetActiveView() {
|
||||
return GetView(m_pTabCtrl->GetCurSel());
|
||||
}
|
||||
AFX_INLINE void CXTTabCtrlBaseEx::SetMenuID(UINT popupMenuID, int nPos) {
|
||||
m_popupMenuID = popupMenuID; m_nPos = nPos;
|
||||
}
|
||||
AFX_INLINE void CXTTabCtrlBaseEx::SendInitialUpdate(BOOL bInitialUpdate) {
|
||||
m_bInitialUpdate = bInitialUpdate;
|
||||
}
|
||||
AFX_INLINE CView* CXTTabCtrlBaseEx::GetLastKnownChildView() {
|
||||
return m_pLastActiveView;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTTABCTRL_H__)
|
||||
388
Editor/XT/Include/XTTabCtrlBar.h
Normal file
388
Editor/XT/Include/XTTabCtrlBar.h
Normal file
@@ -0,0 +1,388 @@
|
||||
// XTTabCtrlBar.h interface for the CXTTabCtrlBar class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTTABCTRLBAR_H__)
|
||||
#define __XTTABCTRLBAR_H__
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTTabCtrlBar is a CXTDockWindow derived class. It is used to implement
|
||||
// a tabbed window similar to Visual Studio's workspace window.
|
||||
class _XT_EXT_CLASS CXTTabCtrlBar : public CXTDockWindow
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTTabCtrlBar)
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTTabCtrlBar object.
|
||||
CXTTabCtrlBar();
|
||||
|
||||
// Summary: Destroys a CXTTabCtrlBar object, handles cleanup and de-allocation.
|
||||
virtual ~CXTTabCtrlBar();
|
||||
|
||||
protected:
|
||||
|
||||
CXTTabCtrl m_tabCtrl; // The tab control.
|
||||
|
||||
public:
|
||||
|
||||
// Returns: A reference to the CXTTabCtrl object associated with this view.
|
||||
// Summary: Call this member function to return a reference pointer to the CXTTabCtrl
|
||||
// object associated with this view.
|
||||
virtual CXTTabCtrl& GetTabCtrl () const;
|
||||
|
||||
// Input: pImageList - Pointer to the image list to be assigned to the tab control.
|
||||
// Returns: A pointer to the previous image list, or NULL, if there is no previous
|
||||
// image list.
|
||||
// Summary: Call this member function to assign an image list to the tab control
|
||||
// associated with this view.
|
||||
virtual CImageList* SetTabImageList(CImageList *pImageList);
|
||||
|
||||
// Input: popupMenuID - ID for the tab control popup menu.
|
||||
// nPos - Index position in the menu resource.
|
||||
// Summary: This member function is used to set the resource ID for the popup menu
|
||||
// used by the tab control.
|
||||
virtual void SetTabMenuID(UINT popupMenuID,int nPos=0);
|
||||
|
||||
// Returns: The resource ID of the menu associated with the tab control.
|
||||
// Summary: This member function returns the menu resource associated with the
|
||||
// tab control.
|
||||
virtual UINT GetTabMenuID();
|
||||
|
||||
// Input: rcChild - A reference to a CRect object to receive the client coordinates.
|
||||
// Summary: This member function copies the child coordinates of the CTabCtrl client
|
||||
// area into the object referenced by 'rcChild'. The client coordinates
|
||||
// specify the upper-left and lower-right corners of the client area.
|
||||
virtual void GetChildRect(CRect& rcChild) const;
|
||||
|
||||
// Input: pView - A pointer to a CWnd object to be resized.
|
||||
// Summary: Call this member function to resize the tab view specified by 'pView'.
|
||||
virtual void ResizeTabView(CWnd* pView);
|
||||
|
||||
// Summary: This member function is called to initialize the font for the tab control
|
||||
// associated with this view.
|
||||
virtual void InitializeFont();
|
||||
|
||||
// Input: dwRemove - Specifies window styles to be removed during style modification.
|
||||
// dwAdd - Specifies window styles to be added during style modification.
|
||||
// nFlags - Flags to be passed to SetWindowPos, or zero if SetWindowPos
|
||||
// should not be called. The default is zero. See CWnd::ModifyStyle
|
||||
// for more details.
|
||||
// Returns: Nonzero if style was successfully modified, otherwise returns zero.
|
||||
// Summary: This member function will modify the style for the tab control associated
|
||||
// with this view and set the appropriate font depending on the tab's
|
||||
// orientation.
|
||||
virtual BOOL ModifyTabStyle(DWORD dwRemove,DWORD dwAdd,UINT nFlags=0);
|
||||
|
||||
// Returns: The handle of the tooltip control if successful, otherwise returns NULL.
|
||||
// Summary: This member function retrieves the handle of the tooltip control associated
|
||||
// with the tab control. The tab control creates a tooltip control if
|
||||
// it has the TCS_TOOLTIPS style. You can also assign a tooltip control
|
||||
// to a tab control by using the SetToolTips member function.
|
||||
virtual CToolTipCtrl* GetTips();
|
||||
|
||||
// Input: pWndTip - Handle of the tooltip control.
|
||||
// Summary: Call this function to assign a tooltip control to the tab control.
|
||||
// You can associate the tooltip control with a tab control by making
|
||||
// a call to GetToolTips.
|
||||
virtual void SetTips(CToolTipCtrl* pWndTip);
|
||||
|
||||
// Input: nIDTab - Index of the tab.
|
||||
// lpszText - Pointer to the text for the tool.
|
||||
// Summary: Call this function to register a tab with the tooltip control, so
|
||||
// that the information stored in the tooltip is displayed when the cursor
|
||||
// is on the tab.
|
||||
virtual void AddToolTip(UINT nIDTab,LPCTSTR lpszText);
|
||||
|
||||
// Input: nIDTab - Index of the tab.
|
||||
// lpszText - Pointer to the text for the tool.
|
||||
// Summary: Call this function to update the tooltip text for the specified tab.
|
||||
virtual void UpdateToolTip(int nIDTab,LPCTSTR lpszText);
|
||||
|
||||
// Input: pViewClass - CRuntimeClass associated with the tab.
|
||||
// lpszText - Pointer to the text for the tool.
|
||||
// Summary: Call this function to update the tooltip text for the tab specified
|
||||
// by 'pViewClass'.
|
||||
virtual void UpdateToolTip(CRuntimeClass *pViewClass,LPCTSTR lpszText);
|
||||
|
||||
// Summary: This member function is called to reset the values for the tooltip
|
||||
// control based upon the information stored for each tab.
|
||||
virtual void ResetToolTips();
|
||||
|
||||
// Input: bEnable - TRUE to enable tooltip usage.
|
||||
// Returns: TRUE if the tooltip control was found and updated, otherwise returns
|
||||
// FALSE.
|
||||
// Summary: Call this member function to enable or disable tooltip usage.
|
||||
virtual BOOL EnableToolTips(BOOL bEnable);
|
||||
|
||||
// Input: lpszLabel - Pointer to the text for the tab associated with the view.
|
||||
// pViewClass - CView runtime class associated with the tab.
|
||||
// pDoc - CDocument associated with the view.
|
||||
// pContext - Create context for the view.
|
||||
// iIndex - Tab index of where to insert the new view. The default is -1 to
|
||||
// insert the new view at the end.
|
||||
// iIconIndex - Icon index for the tab. If -1, 'iIndex' is used to determine
|
||||
// the index.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to add a view to the tab control associated
|
||||
// with this view.
|
||||
virtual BOOL AddView(LPCTSTR lpszLabel,CRuntimeClass *pViewClass,CDocument* pDoc=NULL,CCreateContext* pContext=NULL,int iIndex=-1,int iIconIndex=-1);
|
||||
|
||||
// Input: lpszLabel - Pointer to the text for the tab associated with the view.
|
||||
// pView - An existing view to be added to the tab control.
|
||||
// iIndex - Tab index of where to insert the new view. The default is -1 to
|
||||
// insert the new view at the end.
|
||||
// iIconIndex - Icon index for the tab. If -1, 'iIndex' is used to determine
|
||||
// the index.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to add a view to the tab control associated
|
||||
// with this view.
|
||||
virtual BOOL AddView(LPCTSTR lpszLabel,CView* pView,int iIndex=-1,int iIconIndex=-1);
|
||||
|
||||
// Input: lpszLabel - Pointer to the text for the tab associated with the view.
|
||||
// pView - CWnd object associated with the tab.
|
||||
// iIndex - Tab index of where to insert the new view. The default is -1 to
|
||||
// add the new view to the end.
|
||||
// iIconIndex - Icon index for the tab. If -1, 'iIndex' is used to determine
|
||||
// the index.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: This member function is called to add a control to the tab control
|
||||
// associated with this view.
|
||||
virtual BOOL AddControl(LPCTSTR lpszLabel,CWnd* pView,int iIndex=-1,int iIconIndex=-1);
|
||||
|
||||
// Input: pViewClass - CView runtime class associated with the tab.
|
||||
// Returns: A pointer to a CView object, otherwise returns NULL.
|
||||
// Summary: This member function returns a pointer to a view from the specified
|
||||
// runtime class.
|
||||
virtual CWnd* GetView(CRuntimeClass *pViewClass);
|
||||
|
||||
// Input: nView - Tab index.
|
||||
// Returns: A pointer to a CView object, otherwise returns NULL.
|
||||
// Summary: This member function returns a pointer to a view from the specified
|
||||
// tab index.
|
||||
virtual CWnd* GetView(int nView);
|
||||
|
||||
// Returns: A pointer to the active view, otherwise returns NULL.
|
||||
// Summary: This member function returns a pointer to the active view associated
|
||||
// with the selected tab.
|
||||
virtual CWnd* GetActiveView();
|
||||
|
||||
// Input: pViewClass - CView runtime class associated with the tab.
|
||||
// Summary: This member function will set a view active based on the specified
|
||||
// runtime class.
|
||||
virtual void SetActiveView(CRuntimeClass *pViewClass);
|
||||
|
||||
// Input: pTabView - CWnd object to make active.
|
||||
// Summary: This member function will set a view active based on the specified
|
||||
// runtime class.
|
||||
virtual void SetActiveView(CWnd* pTabView);
|
||||
|
||||
// Input: nActiveTab - Tab index.
|
||||
// Summary: This member function will set a view active based on the specified
|
||||
// tab index.
|
||||
virtual void SetActiveView(int nActiveTab);
|
||||
|
||||
// Input: nView - Tab index of the view.
|
||||
// bDestroyWnd - TRUE to destroy the list item.
|
||||
// Summary: This member function will remove a view based on the specified
|
||||
// tab index.
|
||||
virtual void DeleteView(int nView,BOOL bDestroyWnd=TRUE);
|
||||
|
||||
// Input: pView - Points to the CWnd object associated with the tab.
|
||||
// bDestroyWnd - TRUE to destroy the list item.
|
||||
// Summary: This member function will remove the view specified by 'pView' from
|
||||
// the tab control.
|
||||
virtual void DeleteView(CWnd* pView,BOOL bDestroyWnd=TRUE);
|
||||
|
||||
// Input: pViewClass - CView runtime class associated with the tab.
|
||||
// bDestroyWnd - TRUE to destroy the list item.
|
||||
// Summary: This member function will remove the view specified by 'pViewClass' from
|
||||
// the tab control.
|
||||
virtual void DeleteView(CRuntimeClass *pViewClass,BOOL bDestroyWnd=TRUE);
|
||||
|
||||
// Input: nView - Tab index of the view.
|
||||
// Returns: A NULL terminated string that represents the tab item text.
|
||||
// Summary: This member function will return the name for a view based on the tab index.
|
||||
virtual LPCTSTR GetViewName(int nView);
|
||||
|
||||
// Input: pViewClass - CView runtime class associated with the tab.
|
||||
// Returns: A NULL terminated string that represents the tab item text.
|
||||
// Summary: This member function will retrieve the name for a view based upon a CWnd object.
|
||||
virtual LPCTSTR GetViewName(CRuntimeClass* pViewClass);
|
||||
|
||||
// Input: bDestroyWnd - TRUE to destroy the window associated with the tab item.
|
||||
// Returns: TRUE if successful, otherwise returns FALSE.
|
||||
// Summary: Call this member function to remove all the tabs including all associated views.
|
||||
virtual BOOL RemoveAllTabs(BOOL bDestroyWnd=TRUE);
|
||||
|
||||
// Input: point - Pointer to a CPoint object that contains the cursor screen coordinates.
|
||||
// Use default for the current cursor position.
|
||||
// Returns: The zero-based index of the tab, or <20>1, if no tab is at the specified point.
|
||||
// Summary: Call this member function to retrieve the tab index from the current
|
||||
// cursor position.
|
||||
virtual int GetTabFromPoint(CPoint point);
|
||||
|
||||
// Input: pView - A pointer to a CWnd object.
|
||||
// Returns: TRUE if the specified CWnd object is a child of the tab control, otherwise
|
||||
// returns FALSE.
|
||||
// Summary: Call this member function to see if the specified CWnd object is a
|
||||
// child of the tab control.
|
||||
virtual BOOL IsChildView(CWnd* pView);
|
||||
|
||||
// Input: bEnable - TRUE to enable auto-condense mode.
|
||||
// Summary: Call this member function to enable or disable the tab auto-condensing
|
||||
// mode. Auto-condensing mode affects the tab control's behavior when
|
||||
// there is not enough room to fit all tabs. Without auto-condensation,
|
||||
// the CXTTabCtrl control behaves like a standard tab control (i.e. it
|
||||
// will display a slider control that allows the user to pan between tabs).
|
||||
// With the auto-condensing mode enabled, CXTTabCtrl attempts to fit all
|
||||
// tabs in the available space by trimming the tab label text. This behavior
|
||||
// is similar to the behavior displayed by Visual C++'s Workspace View.
|
||||
// For instance, you can see the FileView tab shrink if you shrink the
|
||||
// Workspace View.
|
||||
void SetAutoCondense(BOOL bEnable);
|
||||
|
||||
// Returns: TRUE if auto-condense is enabled, otherwise returns FALSE.
|
||||
// Summary: This member function returns the state of the tab control's auto-condense
|
||||
// mode. See SetAutoCondense() for a full explanation of this mode.
|
||||
BOOL GetAutoCondense();
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTTabCtrlBar)
|
||||
virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
virtual void OnTabSelChange(int nIDCtrl, CXTTabCtrl* pTabCtrl);
|
||||
virtual void OnTabSelChanging(int nIDCtrl, CXTTabCtrl* pTabCtrl);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTTabCtrlBar)
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnTabSelChange(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnTabSelChanging(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE CXTTabCtrl& CXTTabCtrlBar::GetTabCtrl() const {
|
||||
ASSERT_VALID(this); return (CXTTabCtrl&)m_tabCtrl;
|
||||
}
|
||||
AFX_INLINE CImageList* CXTTabCtrlBar::SetTabImageList(CImageList *pImageList) {
|
||||
ASSERT_VALID(this); return GetTabCtrl().SetImageList(pImageList);
|
||||
}
|
||||
AFX_INLINE void CXTTabCtrlBar::SetTabMenuID(UINT popupMenuID, int nPos) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().SetMenuID(popupMenuID, nPos);
|
||||
}
|
||||
AFX_INLINE UINT CXTTabCtrlBar::GetTabMenuID() {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().GetMenuID();
|
||||
}
|
||||
AFX_INLINE void CXTTabCtrlBar::GetChildRect(CRect& rcChild) const {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().GetChildRect(rcChild);
|
||||
}
|
||||
AFX_INLINE void CXTTabCtrlBar::ResizeTabView(CWnd* pView) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().ResizeTabView(pView);
|
||||
}
|
||||
AFX_INLINE void CXTTabCtrlBar::InitializeFont() {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().InitializeFont();
|
||||
}
|
||||
AFX_INLINE BOOL CXTTabCtrlBar::ModifyTabStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().ModifyTabStyle(dwRemove, dwAdd, nFlags);
|
||||
}
|
||||
AFX_INLINE CToolTipCtrl* CXTTabCtrlBar::GetTips() {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().GetTips();
|
||||
}
|
||||
AFX_INLINE void CXTTabCtrlBar::SetTips(CToolTipCtrl* pWndTip) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().SetTips(pWndTip);
|
||||
}
|
||||
AFX_INLINE void CXTTabCtrlBar::AddToolTip(UINT nIDTab, LPCTSTR lpszText) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().AddToolTip(nIDTab, lpszText);
|
||||
}
|
||||
AFX_INLINE void CXTTabCtrlBar::UpdateToolTip(int nIDTab, LPCTSTR lpszText) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().UpdateToolTip(nIDTab, lpszText);
|
||||
}
|
||||
AFX_INLINE void CXTTabCtrlBar::UpdateToolTip(CRuntimeClass *pViewClass, LPCTSTR lpszText) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().UpdateToolTip(pViewClass, lpszText);
|
||||
}
|
||||
AFX_INLINE void CXTTabCtrlBar::ResetToolTips() {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().ResetToolTips();
|
||||
}
|
||||
AFX_INLINE BOOL CXTTabCtrlBar::EnableToolTips(BOOL bEnable) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().EnableToolTips(bEnable);
|
||||
}
|
||||
AFX_INLINE BOOL CXTTabCtrlBar::AddControl(LPCTSTR lpszLabel, CWnd* pView, int iIndex, int iIconIndex) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().AddControl(lpszLabel, pView, iIndex, iIconIndex);
|
||||
}
|
||||
AFX_INLINE CWnd* CXTTabCtrlBar::GetView(CRuntimeClass *pViewClass) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().GetView(pViewClass);
|
||||
}
|
||||
AFX_INLINE CWnd* CXTTabCtrlBar::GetView(int nView) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().GetView(nView);
|
||||
}
|
||||
AFX_INLINE CWnd* CXTTabCtrlBar::GetActiveView() {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().GetActiveView();
|
||||
}
|
||||
AFX_INLINE void CXTTabCtrlBar::SetActiveView(CRuntimeClass *pViewClass) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().SetActiveView(pViewClass);
|
||||
}
|
||||
AFX_INLINE void CXTTabCtrlBar::SetActiveView(CWnd* pTabView) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().SetActiveView(pTabView);
|
||||
}
|
||||
AFX_INLINE void CXTTabCtrlBar::SetActiveView(int nActiveTab) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().SetActiveView(nActiveTab);
|
||||
}
|
||||
AFX_INLINE void CXTTabCtrlBar::DeleteView(int nView, BOOL bDestroyWnd/*=TRUE*/) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().DeleteView(nView, bDestroyWnd);
|
||||
}
|
||||
AFX_INLINE void CXTTabCtrlBar::DeleteView(CWnd* pView, BOOL bDestroyWnd/*=TRUE*/) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().DeleteView(pView, bDestroyWnd);
|
||||
}
|
||||
AFX_INLINE void CXTTabCtrlBar::DeleteView(CRuntimeClass *pViewClass, BOOL bDestroyWnd/*=TRUE*/) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); GetTabCtrl().DeleteView(pViewClass, bDestroyWnd);
|
||||
}
|
||||
AFX_INLINE LPCTSTR CXTTabCtrlBar::GetViewName(int nView) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().GetViewName(nView);
|
||||
}
|
||||
AFX_INLINE LPCTSTR CXTTabCtrlBar::GetViewName(CRuntimeClass *pViewClass) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().GetViewName(pViewClass);
|
||||
}
|
||||
AFX_INLINE BOOL CXTTabCtrlBar::RemoveAllTabs(BOOL bDestroyWnd/*=TRUE*/) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().RemoveAllTabs(bDestroyWnd);
|
||||
}
|
||||
AFX_INLINE int CXTTabCtrlBar::GetTabFromPoint(CPoint point) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().GetTabFromPoint(point);
|
||||
}
|
||||
AFX_INLINE BOOL CXTTabCtrlBar::IsChildView(CWnd* pView) {
|
||||
ASSERT(::IsWindow(GetTabCtrl().m_hWnd)); return GetTabCtrl().IsChildView(pView);
|
||||
}
|
||||
AFX_INLINE void CXTTabCtrlBar::SetAutoCondense(BOOL bEnable) {
|
||||
GetTabCtrl().SetAutoCondense(bEnable);
|
||||
}
|
||||
AFX_INLINE BOOL CXTTabCtrlBar::GetAutoCondense() {
|
||||
return GetTabCtrl().GetAutoCondense();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTTABCTRLBAR_H__)
|
||||
129
Editor/XT/Include/XTTabView.h
Normal file
129
Editor/XT/Include/XTTabView.h
Normal file
@@ -0,0 +1,129 @@
|
||||
// XTTabView.h interface for the CXTTabView class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTTABVIEW_H__)
|
||||
#define __XTTABVIEW_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTTabView is a multiple inheritance class derived from CCtrlView and
|
||||
// CXTTabCtrlBaseEx. CXTTabView can be used to create a view that contains
|
||||
// nested views displayed in a tab control. See CXTTabCtrlBaseEx for additional
|
||||
// functionality.
|
||||
class _XT_EXT_CLASS CXTTabView : public CCtrlView, public CXTTabCtrlBaseEx
|
||||
{
|
||||
DECLARE_DYNCREATE(CXTTabView)
|
||||
|
||||
friend class CXTTabCtrlBase;
|
||||
friend class CXTTabCtrlBaseEx;
|
||||
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTTabView object.
|
||||
CXTTabView();
|
||||
|
||||
// Summary: Destroys a CXTTabView object, handles cleanup and de-allocation.
|
||||
virtual ~CXTTabView();
|
||||
|
||||
protected:
|
||||
|
||||
public:
|
||||
|
||||
// Returns: A CTabCtrl reference to the object associated with this view.
|
||||
// Summary: Call this member function to retrieve a reference pointer to the CTabCtrl
|
||||
// object associated with this view.
|
||||
virtual CTabCtrl& GetTabCtrl () const;
|
||||
|
||||
// Input: pImageList - Pointer to the image list to be assigned to the tab control.
|
||||
// Returns: A pointer to the previous image list, or NULL, if there is no previous image list.
|
||||
// Summary: Call this function to assign an image list to the tab control associated
|
||||
// with this view.
|
||||
virtual CImageList* SetTabImageList(CImageList *pImageList);
|
||||
|
||||
// Returns: The handle of the tooltip control if successful, otherwise returns NULL.
|
||||
// Summary: This member function retrieves the handle of the tooltip control associated
|
||||
// with the tab control. The tab control creates a tooltip control if
|
||||
// it has the TCS_TOOLTIPS style. You can also assign a tooltip control
|
||||
// to a tab control by using the SetToolTips member function.
|
||||
virtual CToolTipCtrl* GetToolTips();
|
||||
|
||||
// Input: pWndTip - Pointer to a tooltip control.
|
||||
// Summary: Call this function to assign a tooltip control to the tab control.
|
||||
// You can associate the tooltip control with a tab control by making
|
||||
// a call to GetToolTips.
|
||||
virtual void SetToolTips(CToolTipCtrl* pWndTip);
|
||||
|
||||
// Input: bEnable - TRUE to enable tooltip usage.
|
||||
// Returns: TRUE if the tooltip control was found and updated, otherwise returns FALSE.
|
||||
// Summary: Call this member function to enable or disable tooltip usage.
|
||||
virtual BOOL EnableToolTips(BOOL bEnable);
|
||||
|
||||
// Summary: Call this member function to update the document name with the tab
|
||||
// label.
|
||||
void UpdateDocTitle();
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTTabView)
|
||||
public:
|
||||
virtual void OnInitialUpdate();
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTTabView)
|
||||
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnSelchange(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnSelchanging(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message);
|
||||
afx_msg void OnPaint();
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg LRESULT OnInitialize(WPARAM wp, LPARAM lp) { return OnInitializeImpl(wp, lp); };
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE CTabCtrl& CXTTabView::GetTabCtrl() const {
|
||||
ASSERT_VALID(this); return (CTabCtrl&)*this;
|
||||
}
|
||||
AFX_INLINE CImageList* CXTTabView::SetTabImageList(CImageList *pImageList) {
|
||||
ASSERT_VALID(this); return GetTabCtrl().SetImageList(pImageList);
|
||||
}
|
||||
AFX_INLINE CToolTipCtrl* CXTTabView::GetToolTips() {
|
||||
return GetTips();
|
||||
}
|
||||
AFX_INLINE void CXTTabView::SetToolTips(CToolTipCtrl* pWndTip) {
|
||||
SetTips(pWndTip);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(__XTTABVIEW_H__)
|
||||
126
Editor/XT/Include/XTTipOfTheDay.h
Normal file
126
Editor/XT/Include/XTTipOfTheDay.h
Normal file
@@ -0,0 +1,126 @@
|
||||
// XTTipOfTheDay.h interface for the CXTTipOfTheDay class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTTIPOFTHEDAY_H__)
|
||||
#define __XTTIPOFTHEDAY_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTTipOfTheDay is a multiple inheritance class derived from CXTDialogState
|
||||
// and CDialog. CXTTipOfTheDay is used to create a Visual Studio™ style
|
||||
// Tip Of The Day dialog. To use, place a file called "tips.txt" in the
|
||||
// same directory as your application exe. Place each tip on its own line.
|
||||
class _XT_EXT_CLASS CXTTipOfTheDay : CXTDialogState, public CDialog
|
||||
{
|
||||
DECLARE_DYNAMIC(CXTTipOfTheDay)
|
||||
|
||||
public:
|
||||
|
||||
// Input: lpszTipFile - A NULL terminated string that represents the path and file name
|
||||
// of where the tips text file is located. By default, the file name
|
||||
// is set to "tips.txt".
|
||||
// pParent - Points to the parent window for the Tip Of The Day Dialog.
|
||||
// Summary: Constructs a CXTTipOfTheDay object.
|
||||
CXTTipOfTheDay(LPCTSTR lpszTipFile=NULL,CWnd* pParent = NULL);
|
||||
|
||||
// Summary: Destroys a CXTTipOfTheDay object, handles cleanup and de-allocation.
|
||||
virtual ~CXTTipOfTheDay();
|
||||
|
||||
protected:
|
||||
|
||||
FILE* m_pStream; // A pointer to the open file stream.
|
||||
CRect m_rcBorder; // Size of the total display area.
|
||||
CRect m_rcShadow; // Size of the shadowed rect displayed to the left of the tip.
|
||||
CRect m_rcHilite; // Size of the background area the tips are displayed on.
|
||||
CRect m_rcTipText; // Size of the display area for tip text.
|
||||
CFont m_fontTitle; // Default font used for "Did you know..." text.
|
||||
CFont m_fontTip; // Default font used for tips.
|
||||
CFont* m_pFontTitle; // User defined font for "Did you know..." text.
|
||||
CFont* m_pFontTip; // User defined font for tips.
|
||||
CString m_strTipTitle; // Represents the "Did you know" text.
|
||||
CString m_strTipText; // Represents the Tip Of The Day text.
|
||||
CString m_strTipFile; // Represents the file name and path for the tips file.
|
||||
|
||||
public:
|
||||
|
||||
// Input: pFontTitle - Points to a CFont object that represents the new
|
||||
// font to be used for the "Did you know..." text.
|
||||
// pFontTip - Points to a CFont object that represents the new
|
||||
// font to be used for the Tip Of The Day text.
|
||||
// Summary: This member function will set the fonts to be used by the "Did you
|
||||
// know..." and the Tip Of The Day text.
|
||||
virtual void SetDefaultFonts(CFont* pFontTitle,CFont* pFontTip);
|
||||
|
||||
// Input: strNext - A CString reference that represents the next
|
||||
// Tip Of The Day text that is to be displayed.
|
||||
// Summary: This member function will retrieve the next string to be displayed
|
||||
// as the Tip Of The Day.
|
||||
virtual void GetNextTipString(CString& strNext);
|
||||
|
||||
// Input: lpszTitle - Represents a NULL terminated string that is
|
||||
// the string to be displayed in place of the
|
||||
// "Did you know..." text.
|
||||
// Summary: This member function will set the text that is to be displayed
|
||||
// in place of the "Did you know..." string.
|
||||
virtual void SetDefaultTitle(LPCTSTR lpszTitle);
|
||||
|
||||
// Input: lpszTipFile - A NULL terminated string that represents the full
|
||||
// path to where the tips text file is located.
|
||||
// Summary: This member function will set the path to where the tips file is
|
||||
// located.
|
||||
virtual void SetTipsFilePath(LPCTSTR lpszTipFile);
|
||||
|
||||
//{{AFX_DATA(CXTTipOfTheDay)
|
||||
|
||||
enum { IDD = XT_IDD_TIPOFTHEDAY };
|
||||
CButton m_ok;
|
||||
CButton m_showTips;
|
||||
CButton m_btnNextTip;
|
||||
CStatic m_staticBorder;
|
||||
BOOL m_bStartup;
|
||||
//}}AFX_DATA
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTTipOfTheDay)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTTipOfTheDay)
|
||||
afx_msg void OnPaint();
|
||||
virtual BOOL OnInitDialog();
|
||||
virtual void OnOK();
|
||||
afx_msg void OnDaytipNext();
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTTipOfTheDay::SetDefaultTitle(LPCTSTR lpszTitle) {
|
||||
m_strTipTitle = lpszTitle;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTTIPOFTHEDAY_H__)
|
||||
159
Editor/XT/Include/XTTipWindow.h
Normal file
159
Editor/XT/Include/XTTipWindow.h
Normal file
@@ -0,0 +1,159 @@
|
||||
// XTTipWindow.h interface for the CXTTipWindow class.
|
||||
//
|
||||
// This file is a part of the Xtreme Toolkit for MFC.
|
||||
// <20>1998-2003 Codejock Software, All Rights Reserved.
|
||||
//
|
||||
// This source code can only be used under the terms and conditions
|
||||
// outlined in the accompanying license agreement.
|
||||
//
|
||||
// support@codejock.com
|
||||
// http://www.codejock.com
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(__XTTIPWINDOW_H__)
|
||||
#define __XTTIPWINDOW_H__
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Summary: CXTTipWindow is a CWnd derived class. It is used to create a CXTTipWindow
|
||||
// object. CXTTipWindow objects are tooltip style popup windows that can
|
||||
// display useful information to the end user. Possible options include
|
||||
// shadows, borders, and background color settings.
|
||||
class _XT_EXT_CLASS CXTTipWindow : public CWnd
|
||||
{
|
||||
public:
|
||||
|
||||
// Summary: Constructs a CXTTipWindow object.
|
||||
CXTTipWindow();
|
||||
|
||||
// Summary: Destroys a CXTTipWindow object, handles cleanup and de-allocation.
|
||||
virtual ~CXTTipWindow();
|
||||
|
||||
protected:
|
||||
|
||||
int m_nLineSpace; // Amount, in pixels, to space the title and description text.
|
||||
UINT m_nElapse; // Time-out value.
|
||||
UINT m_nEventID; // Timer event ID.
|
||||
CWnd* m_pParentWnd; // Parent window.
|
||||
DWORD m_dwTipStyle; // Initial style for the tip window. See ShowTipWindow(..).
|
||||
CSize m_sizeMargin; // Amount, in pixels, of the tip and side margins of where the tip text is displayed.
|
||||
CRect m_rcWindow; // Initial size of the tip window.
|
||||
CRect m_rcShadow; // Initial size of the tip window shadow.
|
||||
CString m_strTitle; // Title text for the tip window.
|
||||
CString m_strDescrip; // Description text for the tip window.
|
||||
COLORREF m_crBackColor; // Background color for the tip window.
|
||||
COLORREF m_crTextColor; // Text color for the tip window.
|
||||
CStringArray m_arStrings; // Stores strings if the tip is multiline.
|
||||
|
||||
public:
|
||||
|
||||
// Input: nElapse - Specifies the time-out value, in milliseconds, of when the
|
||||
// tip window should close.
|
||||
// Summary: This member function will set the initial time-out value for when
|
||||
// to close the tip window.
|
||||
void SetTimeout(UINT nElapse);
|
||||
|
||||
// Input: lpszTitle - A NULL terminated string that is to be displayed as
|
||||
// the title for the tip window.
|
||||
// lpszDescrip - A NULL terminated string that is to be displayed as
|
||||
// the description text for the tip window.
|
||||
// bRedraw - If TRUE, the tip window will be redrawn.
|
||||
// Summary: This member function will set the text for the title and description
|
||||
// values that are displayed in the tip window.
|
||||
void SetTipText(LPCTSTR lpszTitle,LPCTSTR lpszDescrip,BOOL bRedraw=FALSE);
|
||||
|
||||
// Input: crBackColor - The RGB color value for the background of the tip window.
|
||||
// crTextColor - The RGB color value for the text of the tip window.
|
||||
// bRedraw - If TRUE, the tip window will be redrawn.
|
||||
// Summary: This member function will set the text and background colors for
|
||||
// the tip window display.
|
||||
void SetTipColors(COLORREF crBackColor,COLORREF crTextColor,BOOL bRedraw=FALSE);
|
||||
|
||||
// BULLETED LIST:
|
||||
|
||||
// Input: point - The initial x and y coordinates of where the tip window is
|
||||
// to be displayed.
|
||||
// pParentWnd - Points to the parent window of the tip window.
|
||||
// dwTipStyle - Initial style for the tip window. The desired styles
|
||||
// for the tip window can be one or more of the following:
|
||||
// [ul]
|
||||
// [li]<b>TWS_XT_THICKBORDER</b> This style will cause the tip
|
||||
// window to display a thick border around its edges.[/li]
|
||||
// [li]<b>TWS_XT_DROPSHADOW</b> This style will cause the tip
|
||||
// window to cast a shadow on the parent window.[/li]
|
||||
// [li]<b>TWS_XT_ALPHASHADOW</b> Used with TWS_XT_DROPSHADOW to display
|
||||
// an alpha style shadow. By default, mono shadowing is enabled.[/li]
|
||||
// [/ul]
|
||||
// nElapse - Specifies the time-out value, in milliseconds, of when
|
||||
// the tip window should close.
|
||||
// bCenterHorz - Set this parameter to true to center the window horizontally on
|
||||
// the point passed in.
|
||||
// Returns: TRUE if the tip window was successfully created, otherwise returns FALSE.
|
||||
// Summary: This member function will display a tip window to display a title
|
||||
// and description text.
|
||||
virtual BOOL ShowTipWindow(const CPoint& point,CWnd* pParentWnd,DWORD dwTipStyle=TWS_XT_DROPSHADOW,UINT nElapse=5000,bool bCenterHorz = false);
|
||||
|
||||
// Input: size - Initial size for the horizontal and vertical text margins.
|
||||
// Summary: This member function will set the text margins for the tip window.
|
||||
void SetMargins(CSize size);
|
||||
|
||||
// Input: nLineSpace - Initial size for text line spacing.
|
||||
// Summary: This member function will set the line spacing for the tip window.
|
||||
void SetLineSpace(int nLineSpace);
|
||||
|
||||
protected:
|
||||
|
||||
// Input: pDC - Device context of the window to cast the shadow on.
|
||||
// rect - Initial size of the shadow.
|
||||
// Summary: This member function will draw a shadow rect to the device context
|
||||
// specified by 'pDC'.
|
||||
void DrawShadowRect(CDC* pDC,const CRect& rect);
|
||||
|
||||
// Input: point - The x and y coordinates of where the tip window is to be displayed.
|
||||
// Summary: This member function will set the sizes for the tip window.
|
||||
void InitializeSize(const CPoint& point);
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_VIRTUAL(CXTTipWindow)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Ignore:
|
||||
//{{AFX_MSG(CXTTipWindow)
|
||||
afx_msg void OnKillFocus(CWnd* pNewWnd);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnTimer(UINT_PTR nIDEvent);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
AFX_INLINE void CXTTipWindow::SetTipText(LPCTSTR lpszTitle, LPCTSTR lpszDescrip, BOOL bRedraw) {
|
||||
m_strTitle = lpszTitle; m_strDescrip = lpszDescrip; if (bRedraw) { InvalidateRect(NULL); }
|
||||
}
|
||||
AFX_INLINE void CXTTipWindow::SetTipColors(COLORREF crBackColor, COLORREF crTextColor, BOOL bRedraw) {
|
||||
m_crBackColor = crBackColor; m_crTextColor = crTextColor; if (bRedraw) { InvalidateRect(NULL); }
|
||||
}
|
||||
AFX_INLINE void CXTTipWindow::SetMargins(CSize size) {
|
||||
m_sizeMargin.cx = __max(3, size.cx); m_sizeMargin.cy = __max(3, size.cy);
|
||||
}
|
||||
AFX_INLINE void CXTTipWindow::SetLineSpace(int nLineSpace) {
|
||||
m_nLineSpace = __max(2, nLineSpace);
|
||||
}
|
||||
AFX_INLINE void CXTTipWindow::SetTimeout(UINT nElapse) {
|
||||
m_nElapse = nElapse;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // #if !defined(__XTTIPWINDOW_H__)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user