[saco] Implement CDXUTControl constructor

This commit is contained in:
RD42 2024-05-15 22:52:08 +08:00
parent 1675c68d5e
commit 747d865c87
2 changed files with 83 additions and 0 deletions

View File

@ -84,6 +84,40 @@ void CDXUTDialogResourceManager::OnDestroyDevice()
}
//--------------------------------------------------------------------------------------
// CDXUTControl class
//--------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------
// MATCH
CDXUTControl::CDXUTControl( CDXUTDialog *pDialog )
{
m_Type = DXUT_CONTROL_BUTTON;
m_pDialog = pDialog;
m_ID = 0;
m_Index = 0;
m_pUserData = NULL;
m_bEnabled = true;
m_bVisible = true;
m_bMouseOver = false;
m_bHasFocus = false;
m_bIsDefault = false;
m_pDialog = NULL;
m_x = 0;
m_y = 0;
m_width = 0;
m_height = 0;
ZeroMemory( &m_rcBoundingBox, sizeof( m_rcBoundingBox ) );
}
//--------------------------------------------------------------------------------------
void DXUTBlendColor::Init( D3DCOLOR defaultColor, D3DCOLOR disabledColor, D3DCOLOR hiddenColor )
{

View File

@ -13,6 +13,20 @@
//--------------------------------------------------------------------------------------
// Enums for pre-defined control types
//--------------------------------------------------------------------------------------
enum DXUT_CONTROL_TYPE
{
DXUT_CONTROL_BUTTON,
DXUT_CONTROL_STATIC,
DXUT_CONTROL_CHECKBOX,
DXUT_CONTROL_RADIOBUTTON,
DXUT_CONTROL_COMBOBOX,
DXUT_CONTROL_SLIDER,
DXUT_CONTROL_EDITBOX,
DXUT_CONTROL_IMEEDITBOX,
DXUT_CONTROL_LISTBOX,
DXUT_CONTROL_SCROLLBAR,
};
enum DXUT_CONTROL_STATE
{
DXUT_STATE_NORMAL = 0,
@ -97,4 +111,39 @@ protected:
};
//-----------------------------------------------------------------------------
// Base class for controls
//-----------------------------------------------------------------------------
class CDXUTControl
{
public:
CDXUTControl( CDXUTDialog *pDialog = NULL );
bool m_bVisible; // Shown/hidden flag
bool m_bMouseOver; // Mouse pointer is above control
bool m_bHasFocus; // Control has input focus
bool m_bIsDefault; // Is the default control
// Size, scale, and positioning members
int m_x, m_y;
int m_width, m_height;
// These members are set by the container
CDXUTDialog* m_pDialog; // Parent container
UINT m_Index; // Index within the control list
CGrowableArray< CDXUTElement* > m_Elements; // All display elements
protected:
int m_ID; // ID number
DXUT_CONTROL_TYPE m_Type; // Control type, set once in constructor
UINT m_nHotkey; // Virtual key code for this control's hotkey
void *m_pUserData; // Data associated with this control that is set by user.
bool m_bEnabled; // Enabled/disabled flag
RECT m_rcBoundingBox; // Rectangle defining the active region of the control
};
#endif // DXUT_GUI_H