本文整理汇总了C++中MapDialogRect函数的典型用法代码示例。如果您正苦于以下问题:C++ MapDialogRect函数的具体用法?C++ MapDialogRect怎么用?C++ MapDialogRect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MapDialogRect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetWindowText
LRESULT CModuleSettings::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) {
std::wstring strWName;
WinUTF8::UTF8string_to_wstring(m_strModuleName, strWName);
SetWindowText(strWName.c_str());
int iDlgWidth = 7 + CModuleControl::CAPTION_WIDTH + CModuleControl::CHILD_WIDTH + 7;
int iTop = 7;
for (int i(0); i < m_iCount; ++i) {
RECT controlRect = { 7, iTop, iDlgWidth - 7, iTop + m_pControls[i]->GetHeight() };
MapDialogRect(&controlRect);
m_pControls[i]->Create(m_hWnd, controlRect);
m_pControls[i]->Initialise(m_pAppSets);
iTop += m_pControls[i]->GetHeight() + 2;
}
iTop += -2 + 7;
MoveButton(IDCANCEL, iDlgWidth - 57, iTop);
MoveButton(IDOK, iDlgWidth - 2 * (57), iTop);
RECT size = { 0, 0, iDlgWidth, iTop + 14 + 7 };
MapDialogRect(&size);
ResizeClient(size.right, size.bottom);
SendMessageToDescendants(WM_SETFONT, (WPARAM)GetFont(), true);
return 1;
}
示例2: create_joystick_type_selector
static void
create_joystick_type_selector( struct joystick_info *info, HWND hwndDlg )
{
size_t i;
HFONT font;
RECT rect;
font = ( HFONT ) SendMessage( hwndDlg, WM_GETFONT, 0, 0 );
for( i = 0; i < JOYSTICK_TYPE_COUNT; i++ ) {
rect.left = 5; rect.top = i * 10 + 10 ;
rect.right = 5 + 45; rect.bottom = ( i * 10 ) + 10 + 10;
MapDialogRect( hwndDlg, &rect );
info->radio[ i ] = CreateWindowEx( 0, WC_BUTTON, joystick_name[ i ],
WS_VISIBLE | WS_CHILD |
WS_TABSTOP | BS_AUTORADIOBUTTON,
rect.left, rect.top,
rect.right - rect.left,
rect.bottom - rect.top,
hwndDlg, 0, fuse_hInstance, 0 );
SendMessage( info->radio[ i ], WM_SETFONT, ( WPARAM ) font, FALSE );
if( i == *( info->type ) )
SendMessage( info->radio[ i ], BM_SETCHECK, BST_CHECKED, 0 );
}
rect.left = 0; rect.top = 0;
rect.right = 60; rect.bottom = ( i * 10 ) + 10 + 10 + 5;
MapDialogRect( hwndDlg, &rect );
MoveWindow( GetDlgItem( hwndDlg, IDR_JOYSTICKS_POPUP ),
rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top,
FALSE );
}
示例3: if
BOOL CALLBACK W32StandaloneDialogPanel::StaticCallback(HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam) {
if (message == WM_INITDIALOG) {
((W32DialogPanel*)lParam)->init(hDialog);
return true;
} else if (message == WM_COMMAND) {
W32DialogPanel *panel = ourPanels[hDialog];
if (panel != 0) {
return panel->commandCallback(wParam);
}
} else if (message == WM_NOTIFY) {
W32DialogPanel *panel = ourPanels[hDialog];
if (panel != 0) {
return panel->notificationCallback(wParam, lParam);
}
} else if (message == WM_GETMINMAXINFO) {
W32DialogPanel *panel = ourPanels[hDialog];
if (panel != 0) {
POINT &minTrackSize = ((MINMAXINFO*)lParam)->ptMinTrackSize;
W32Widget::Size minSize = panel->minimumSize();
RECT r;
r.left = 0;
r.top = 0;
r.right = minSize.Width;
r.bottom = minSize.Height;
MapDialogRect(hDialog, &r);
minTrackSize.x = std::max(minTrackSize.x, r.right);
minTrackSize.y += r.bottom;
return true;
}
} else if (message == WM_SIZE) {
W32DialogPanel *panel = ourPanels[hDialog];
if (panel != 0) {
RECT r;
r.left = 0;
r.top = 0;
r.right = 100;
r.bottom = 100;
MapDialogRect(hDialog, &r);
panel->setSize(W32Widget::Size(
(int)LOWORD(lParam) * 100 / r.right,
(int)HIWORD(lParam) * 100 / r.bottom));
panel->updateElementSize();
}
return false;
} else if (message == WM_DRAWITEM) {
W32DialogPanel *panel = ourPanels[hDialog];
if (panel != 0) {
return panel->drawItemCallback(wParam, *(DRAWITEMSTRUCT*)lParam);
}
} else if (message == LAYOUT_MESSAGE) {
W32DialogPanel *panel = ourPanels[hDialog];
if (panel != 0) {
panel->layout();
return true;
}
}
return false;
}
示例4: GetCaptionHeight
void CModuleControl::Create(HWND hParent, RECT& rect)
{
CWindowImpl<CModuleControl>::Create(hParent, rect);
RECT captionRect = { 0, 0, CAPTION_WIDTH, GetCaptionHeight() };
MapDialogRect(hParent, &captionRect);
m_hCaption.Create(TEXT("STATIC"), *this, captionRect, m_strCaption.c_str(), WS_CHILD | WS_VISIBLE);
RECT childRect = { CAPTION_WIDTH, 0, CAPTION_WIDTH + CHILD_WIDTH, GetChildHeight() };
MapDialogRect(hParent, &childRect);
CreateChild(*this, childRect);
};
示例5: add_rom
static void
add_rom( HWND hwndDlg, size_t start, size_t row )
{
RECT rect;
HFONT font;
HWND hgroup, hedit, hbutton;
TCHAR buffer[ 80 ], **setting;
_sntprintf( buffer, 80, "ROM %d", row );
font = ( HFONT ) SendMessage( hwndDlg, WM_GETFONT, 0, 0 );
/* create a groupbox */
rect.left = 0; rect.top = ( row * 30 );
rect.right = 160; rect.bottom = ( row * 30 ) + 30;
MapDialogRect( hwndDlg, &rect );
hgroup = CreateWindowEx( 0, WC_BUTTON, buffer,
WS_VISIBLE | WS_CHILD | BS_GROUPBOX,
rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top,
hwndDlg, 0, fuse_hInstance, 0 );
SendMessage( hgroup, WM_SETFONT, ( WPARAM ) font, FALSE );
/* create an edit */
setting = settings_get_rom_setting( &settings_current, start + row );
rect.left = 5; rect.top = ( row * 30 ) + 10;
rect.right = 5 + 110; rect.bottom = ( row * 30 ) + 10 + 14;
MapDialogRect( hwndDlg, &rect );
hedit = CreateWindowEx( 0, WC_EDIT, *setting,
WS_VISIBLE | WS_CHILD | WS_TABSTOP
| WS_BORDER | ES_AUTOHSCROLL,
rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top,
hwndDlg, 0, fuse_hInstance, 0 );
SendMessage( hedit, WM_SETFONT, ( WPARAM ) font, FALSE );
rom[ row ] = hedit;
/* create a select... button */
rect.left = 120; rect.top = ( row * 30 ) + 10;
rect.right = 120 + 35; rect.bottom = ( row * 30 ) + 10 + 14;
MapDialogRect( hwndDlg, &rect );
hbutton = CreateWindowEx( 0, WC_BUTTON, TEXT( "Select..." ),
WS_VISIBLE | WS_CHILD | WS_TABSTOP,
rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top,
hwndDlg, 0, fuse_hInstance, 0 );
SendMessage( hbutton, WM_SETFONT, ( WPARAM ) font, FALSE );
/* associate handle to the edit box with each Select button as user data */
SetWindowLong( hbutton, GWL_USERDATA, ( LONG ) hedit );
}
示例6: roms_init
static void
roms_init( HWND hwndDlg, LPARAM lParam )
{
size_t i;
struct callback_info *info;
info = ( struct callback_info * ) lParam;
for( i = 0; i < info->n; i++ ) add_rom( hwndDlg, info->start, i );
/* Move the OK and Cancel buttons */
RECT rect;
rect.left = 25; rect.top = ( info->n * 30 ) + 5;
rect.right = 25 + 50; rect.bottom = ( info->n * 30 ) + 5 + 14;
MapDialogRect( hwndDlg, &rect );
MoveWindow( GetDlgItem( hwndDlg, IDOK ),
rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top,
FALSE );
rect.left = 85; rect.top = ( info->n * 30 ) + 5;
rect.right = 85 + 50; rect.bottom = ( info->n * 30 ) + 5 + 14;
MapDialogRect( hwndDlg, &rect );
MoveWindow( GetDlgItem( hwndDlg, IDCANCEL ),
rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top,
FALSE );
/* resize the dialog as needed */
RECT window_rect, client_rect;
GetWindowRect( hwndDlg, &window_rect );
GetClientRect( hwndDlg, &client_rect );
rect.left = 0; rect.top = 0;
rect.right = 163; rect.bottom = ( info->n * 30 ) + 24;
MapDialogRect( hwndDlg, &rect );
/* rect now contains the size of the client area in pixels,
now add window's absolute position on the screen */
rect.left += window_rect.left;
rect.top += window_rect.top;
/* now just add the difference between client area and window area */
rect.right += ( window_rect.right - window_rect.left )
- ( client_rect.right - client_rect.left );
rect.bottom += ( window_rect.bottom - window_rect.top )
- ( client_rect.bottom - client_rect.top );
/* MoveWindow doesn't really take rect, instead it's X, Y, sizeX and sizeY */
MoveWindow( hwndDlg, rect.left, rect.top, rect.right, rect.bottom, FALSE );
}
示例7: CDialog
CELFProgramView::CELFProgramView(HWND hParent, CELF* pELF)
: CDialog(MAKEINTRESOURCE(IDD_ELFVIEW_PROGRAMVIEW), hParent)
, m_nProgram(-1)
, m_pELF(pELF)
{
SetClassPtr();
m_pType = new Framework::Win32::CEdit(GetItem(IDC_ELFVIEW_PROGRAMVIEW_TYPE_EDIT));
m_pOffset = new Framework::Win32::CEdit(GetItem(IDC_ELFVIEW_PROGRAMVIEW_OFFSET_EDIT));
m_pVAddr = new Framework::Win32::CEdit(GetItem(IDC_ELFVIEW_PROGRAMVIEW_VADDR_EDIT));
m_pPAddr = new Framework::Win32::CEdit(GetItem(IDC_ELFVIEW_PROGRAMVIEW_PADDR_EDIT));
m_pFileSize = new Framework::Win32::CEdit(GetItem(IDC_ELFVIEW_PROGRAMVIEW_FILESIZE_EDIT));
m_pMemSize = new Framework::Win32::CEdit(GetItem(IDC_ELFVIEW_PROGRAMVIEW_MEMSIZE_EDIT));
m_pFlags = new Framework::Win32::CEdit(GetItem(IDC_ELFVIEW_PROGRAMVIEW_FLAGS_EDIT));
m_pAlign = new Framework::Win32::CEdit(GetItem(IDC_ELFVIEW_PROGRAMVIEW_ALIGN_EDIT));
RECT columnEditBoxSize;
SetRect(&columnEditBoxSize, 0, 0, 70, 12);
MapDialogRect(m_hWnd, &columnEditBoxSize);
unsigned int columnEditBoxWidth = columnEditBoxSize.right - columnEditBoxSize.left;
unsigned int columnEditBoxHeight = columnEditBoxSize.bottom - columnEditBoxSize.top;
RECT columnLabelSize;
SetRect(&columnLabelSize, 0, 0, 70, 8);
MapDialogRect(m_hWnd, &columnLabelSize);
unsigned int columnLabelWidth = columnLabelSize.right - columnLabelSize.left;
unsigned int columnLabelHeight = columnLabelSize.bottom - columnLabelSize.top;
m_pLayout = Framework::CGridLayout::Create(2, 9);
m_pLayout->SetObject(0, 0, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnLabelWidth, columnLabelHeight, new Framework::Win32::CStatic(GetItem(IDC_ELFVIEW_PROGRAMVIEW_TYPE_LABEL))));
m_pLayout->SetObject(0, 1, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnLabelWidth, columnLabelHeight, new Framework::Win32::CStatic(GetItem(IDC_ELFVIEW_PROGRAMVIEW_OFFSET_LABEL))));
m_pLayout->SetObject(0, 2, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnLabelWidth, columnLabelHeight, new Framework::Win32::CStatic(GetItem(IDC_ELFVIEW_PROGRAMVIEW_VADDR_LABEL))));
m_pLayout->SetObject(0, 3, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnLabelWidth, columnLabelHeight, new Framework::Win32::CStatic(GetItem(IDC_ELFVIEW_PROGRAMVIEW_PADDR_LABEL))));
m_pLayout->SetObject(0, 4, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnLabelWidth, columnLabelHeight, new Framework::Win32::CStatic(GetItem(IDC_ELFVIEW_PROGRAMVIEW_FILESIZE_LABEL))));
m_pLayout->SetObject(0, 5, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnLabelWidth, columnLabelHeight, new Framework::Win32::CStatic(GetItem(IDC_ELFVIEW_PROGRAMVIEW_MEMSIZE_LABEL))));
m_pLayout->SetObject(0, 6, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnLabelWidth, columnLabelHeight, new Framework::Win32::CStatic(GetItem(IDC_ELFVIEW_PROGRAMVIEW_FLAGS_LABEL))));
m_pLayout->SetObject(0, 7, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnLabelWidth, columnLabelHeight, new Framework::Win32::CStatic(GetItem(IDC_ELFVIEW_PROGRAMVIEW_ALIGN_LABEL))));
m_pLayout->SetObject(1, 0, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnEditBoxWidth, columnEditBoxHeight, m_pType));
m_pLayout->SetObject(1, 1, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnEditBoxWidth, columnEditBoxHeight, m_pOffset));
m_pLayout->SetObject(1, 2, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnEditBoxWidth, columnEditBoxHeight, m_pVAddr));
m_pLayout->SetObject(1, 3, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnEditBoxWidth, columnEditBoxHeight, m_pPAddr));
m_pLayout->SetObject(1, 4, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnEditBoxWidth, columnEditBoxHeight, m_pFileSize));
m_pLayout->SetObject(1, 5, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnEditBoxWidth, columnEditBoxHeight, m_pMemSize));
m_pLayout->SetObject(1, 6, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnEditBoxWidth, columnEditBoxHeight, m_pFlags));
m_pLayout->SetObject(1, 7, Framework::Win32::CLayoutWindow::CreateTextBoxBehavior(columnEditBoxWidth, columnEditBoxHeight, m_pAlign));
m_pLayout->SetObject(1, 8, Framework::CLayoutStretch::Create());
RefreshLayout();
}
示例8: rectUnits
void CGameParamsSheet::InitButtons()
{
// Calculate the height of 7 dialog units
CRect rectUnits(0, 0, 0, 7);
//mmf vc8 does not like two arguments, below was commented out, I uncommented it - Imago made them co-exist
#if _MSC_VER >= 1400
MapDialogRect(rectUnits);
#else
MapDialogRect(GetSafeHwnd(), rectUnits);
#endif
// Get the OK and cancel buttons
CWnd* pwndOK = GetDlgItem(IDOK);
CWnd* pwndCancel = GetDlgItem(IDCANCEL);
CWnd* pwndHelp = GetDlgItem(IDHELP);
// Get the window rectangles of the buttons
CRect rectOK, rectCancel, rectHelp;
pwndOK->GetWindowRect(rectOK);
pwndCancel->GetWindowRect(rectCancel);
pwndHelp->GetWindowRect(rectHelp);
ScreenToClient(rectOK);
ScreenToClient(rectCancel);
ScreenToClient(rectHelp);
// Compute the offset to position these buttons flush-right
int cxOffset = rectHelp.right - rectCancel.right;
// Move the buttons into place
rectOK.OffsetRect(cxOffset, 0);
rectCancel.OffsetRect(cxOffset, 0);
pwndOK->MoveWindow(rectOK);
pwndCancel->MoveWindow(rectCancel);
// Hide the Apply and Help buttons
GetDlgItem(ID_APPLY_NOW)->ShowWindow(SW_HIDE);
GetDlgItem(IDHELP)->ShowWindow(SW_HIDE);
// Show the OK and Cancel buttons
GetDlgItem(IDOK)->ShowWindow(SW_SHOW);
GetDlgItem(IDCANCEL)->ShowWindow(SW_SHOW);
// Enable the OK and Cancel buttons
GetDlgItem(IDOK)->EnableWindow(true);
GetDlgItem(IDCANCEL)->EnableWindow(true);
}
示例9: switch
BOOL dialog_resize_helper::ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& lResult) {
switch(uMsg) {
case WM_SIZE:
on_wm_size();
return FALSE;
case WM_GETMINMAXINFO:
{
RECT r;
LPMINMAXINFO info = (LPMINMAXINFO) lParam;
DWORD dwStyle = GetWindowLongPtr(hWnd, GWL_STYLE);
DWORD dwExStyle = GetWindowLongPtr(hWnd, GWL_EXSTYLE);
if (max_x && max_y)
{
r.left = 0; r.right = max_x;
r.top = 0; r.bottom = max_y;
MapDialogRect(hWnd,&r);
AdjustWindowRectEx(&r, dwStyle, FALSE, dwExStyle);
info->ptMaxTrackSize.x = r.right - r.left;
info->ptMaxTrackSize.y = r.bottom - r.top;
}
if (min_x && min_y)
{
r.left = 0; r.right = min_x;
r.top = 0; r.bottom = min_y;
MapDialogRect(hWnd,&r);
AdjustWindowRectEx(&r, dwStyle, FALSE, dwExStyle);
info->ptMinTrackSize.x = r.right - r.left;
info->ptMinTrackSize.y = r.bottom - r.top;
}
}
lResult = 0;
return TRUE;
case WM_INITDIALOG:
set_parent(hWnd);
{
t_size n;
for(n=0;n<m_table.get_size();n++) {
GetChildWindowRect(parent,m_table[n].id,&rects[n]);
}
}
return FALSE;
case WM_DESTROY:
reset();
return FALSE;
default:
return FALSE;
}
}
示例10: convert_coords_list
int convert_coords_list(HWND hwnd,short *list,int count)
{
int i;
for(i=0;i<count;i+=2){
int token=list[i];
if(token==RESIZE_FINISH)
break;
switch(token){
case CONTROL_ID:
case CONTROL_FINISH:
break;
case XPOS:
case WIDTH:
case HUG_L:
case HUG_R:
case HUG_CTRL_X:
case HUG_WIDTH:
case HUG_CTRL_TXT_X:
case HUG_CTRL_TXT_X_:
case SIZE_WIDTH_OFF:
{
RECT rect={0};
rect.right=list[i+1];
if(MapDialogRect(hwnd,&rect))
list[i+1]=(short)rect.right;
}
break;
case YPOS:
case HEIGHT:
case HUG_T:
case HUG_B:
case HUG_CTRL_Y:
case HUG_HEIGHT:
case HUG_CTRL_TXT_Y:
case HUG_CTRL_TXT_Y_:
case SIZE_HEIGHT_OFF:
{
RECT rect={0};
rect.bottom=list[i+1];
if(MapDialogRect(hwnd,&rect))
list[i+1]=(short)rect.bottom;
}
break;
}
}
return 0;
}
示例11: CDialog
CThreadCallStackViewWnd::CThreadCallStackViewWnd(HWND parentWindow)
: CDialog(MAKEINTRESOURCE(IDD_DEBUG_THREADCALLSTACK), parentWindow)
, m_hasSelection(false)
, m_selectedAddress(0)
{
SetClassPtr();
m_okButton = new Framework::Win32::CButton(GetItem(IDOK));
m_cancelButton = new Framework::Win32::CButton(GetItem(IDCANCEL));
m_callStackItemList = new Framework::Win32::CListBox(GetItem(IDC_CALLSTACKITEM_LIST));
RECT buttonSize;
SetRect(&buttonSize, 0, 0, 75, 16);
MapDialogRect(m_hWnd, &buttonSize);
unsigned int buttonWidth = buttonSize.right - buttonSize.left;
unsigned int buttonHeight = buttonSize.bottom - buttonSize.top;
m_layout =
Framework::VerticalLayoutContainer
(
Framework::LayoutExpression(Framework::Win32::CLayoutWindow::CreateCustomBehavior(100, 20, 1, 1, m_callStackItemList)) +
Framework::HorizontalLayoutContainer
(
Framework::LayoutExpression(Framework::Win32::CLayoutWindow::CreateButtonBehavior(buttonWidth, buttonHeight, m_okButton)) +
Framework::LayoutExpression(Framework::CLayoutStretch::Create()) +
Framework::LayoutExpression(Framework::Win32::CLayoutWindow::CreateButtonBehavior(buttonWidth, buttonHeight, m_cancelButton))
)
);
{
RECT rc = GetClientRect();
m_layout->SetRect(rc.left + 10, rc.top + 10, rc.right - 10, rc.bottom - 10);
m_layout->RefreshGeometry();
}
}
示例12: SetWindowText
BOOL CGeneralMsgBox::OnInitDialog()
{
if (!CDialog::OnInitDialog())
return FALSE;
SetWindowText(m_strTitle);
// Getting the base dialog unit used in pixel <-> d.u. conversion
CRect rc(0, 0, CX_DLGUNIT_BASE, CY_DLGUNIT_BASE);
MapDialogRect(rc);
m_dimDlgUnit = rc.Size();
// Creating the nested controls
CreateRtfCtrl();
CreateIcon();
CreateBtns();
// Updating the layout - preparing to show
UpdateLayout();
// Disabling the ESC key
if (m_uiEscCmdId == (UINT)IDC_STATIC)
ModifyStyle(WS_SYSMENU, NULL);
// Focusing and setting the defaul button
if (m_uiDefCmdId != (UINT)IDC_STATIC) {
GetDlgItem(m_uiDefCmdId)->SetFocus();
SetDefID(m_uiDefCmdId);
return FALSE;
}
return TRUE;
}
示例13: zMapDialogRect
void far pascal zMapDialogRect( HWND pp1, LPRECT pp2 )
{
SaveRegs();
/*
** Log IN Parameters (No Create/Destroy Checking Yet!)
*/
LogIn( (LPSTR)"APICALL:MapDialogRect HWND+LPRECT+",
pp1, pp2 );
/*
** Call the API!
*/
RestoreRegs();
GrovelDS();
MapDialogRect(pp1,pp2);
UnGrovelDS();
SaveRegs();
/*
** Log Return Code & OUT Parameters (No Create/Destroy Checking Yet!)
*/
LogOut( (LPSTR)"APIRET:MapDialogRect +LPRECT+",
(short)0, pp2 );
RestoreRegs();
return;
}
示例14: MapDialogRect
vduirect VDUIBaseWindowW32::MapUnitsToPixels(vduirect r) {
RECT rwin = {r.left, r.top, r.right, r.bottom};
MapDialogRect(mhwnd, &rwin);
return vduirect(rwin.left, rwin.top, rwin.right, rwin.bottom);
}
示例15: switch
void CXUIDatePicker::Init()
{
DWORD wStyle = WS_CHILD | WS_TABSTOP;
if(m_showNone) wStyle |= DTS_SHOWNONE;
if(m_useSpin) wStyle |= DTS_UPDOWN;
switch(m_format)
{
case XUI_DATE_FORMAT_LONG:
wStyle |= DTS_LONGDATEFORMAT;
break;
case XUI_DATE_FORMAT_TIME:
wStyle |= DTS_TIMEFORMAT;
break;
default:
wStyle |= DTS_SHORTDATEFORMAT;
break;
}
if(get_disabled()) wStyle |= WS_DISABLED;
if(!get_hidden()) wStyle |= WS_VISIBLE;
m_hWnd = CreateWindowEx(0, DATETIMEPICK_CLASS, L"", wStyle, m_left, m_top, m_width, m_height, m_parent->get_parentWnd(), (HMENU) m_id, m_engine->get_hInstance(), NULL);
RECT rcDlg = {0, 0, 100, 14};
if(m_width) rcDlg.right = m_width;
if(m_height) rcDlg.bottom = m_height;
MapDialogRect(m_parent->get_parentWnd(), &rcDlg);
m_minWidth = rcDlg.right;
m_minHeight = rcDlg.bottom;
CXUIElement::Init();
}