本文整理汇总了C++中MapDialogRect函数的典型用法代码示例。如果您正苦于以下问题:C++ MapDialogRect函数的具体用法?C++ MapDialogRect怎么用?C++ MapDialogRect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MapDialogRect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:Afelio,项目名称:dasher,代码行数:28,代码来源:ModuleSettings.cpp
示例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 );
}
开发者ID:CiaranG,项目名称:ZXdroid,代码行数:35,代码来源:win32joystick.c
示例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;
}
开发者ID:euroelessar,项目名称:FBReader,代码行数:58,代码来源:W32StandaloneDialogPanel.cpp
示例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);
};
开发者ID:Afelio,项目名称:dasher,代码行数:12,代码来源:ModuleControl.cpp
示例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 );
}
开发者ID:CiaranG,项目名称:ZXdroid,代码行数:53,代码来源:roms.c
示例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 );
}
开发者ID:CiaranG,项目名称:ZXdroid,代码行数:53,代码来源:roms.c
示例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();
}
开发者ID:250394,项目名称:Play-,代码行数:51,代码来源:ELFProgramView.cpp
示例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);
}
开发者ID:AllegianceZone,项目名称:Allegiance,代码行数:48,代码来源:GameParamsSheet.cpp
示例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;
}
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:48,代码来源:dialog_resize_helper.cpp
示例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;
}
开发者ID:pinchyCZN,项目名称:slimIRC,代码行数:48,代码来源:resize.c
示例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();
}
}
开发者ID:250394,项目名称:Play-,代码行数:35,代码来源:ThreadCallStackViewWnd.cpp
示例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;
}
开发者ID:macduff,项目名称:passwordsafe,代码行数:35,代码来源:GeneralMsgBox.cpp
示例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;
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:27,代码来源:tudlg.c
示例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);
}
开发者ID:KGE-INC,项目名称:VirtualDub,代码行数:7,代码来源:w32base.cpp
示例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();
}
开发者ID:githubwanghui,项目名称:xuilib,代码行数:33,代码来源:XUIDatePicker.cpp
示例16: CalcDlgWindowSize
//
// hwnd - window to calc
// szDlgUnits - (input) size in dialog units
// szClient - (output) size of client area in pixels
// szWindow - (output) total size of based on current settings
//
void CalcDlgWindowSize(HWND hwnd, SIZE *szDlgUnits, SIZE *szClient, SIZE *szWindow)
{
RECT rect;
DWORD dwStyle;
DWORD dwStyleEx;
// work out the size in pixels of our main window, by converting
// from dialog units
SetRect(&rect, 0, 0, szDlgUnits->cx, szDlgUnits->cy);
MapDialogRect(hwnd, &rect);
if (szClient)
{
szClient->cx = GetRectWidth(&rect);
szClient->cy = GetRectHeight(&rect);
}
dwStyle = GetWindowLong(hwnd, GWL_STYLE);
dwStyleEx = GetWindowLong(hwnd, GWL_EXSTYLE);
AdjustWindowRectEx(&rect, dwStyle, FALSE, dwStyleEx);
if (szWindow)
{
szWindow->cx = GetRectWidth(&rect);
szWindow->cy = GetRectHeight(&rect);
}
}
开发者ID:RaMMicHaeL,项目名称:winspy,代码行数:34,代码来源:WinSpyWindow.c
示例17: LayoutNetStartPane
int LayoutNetStartPane (HWND pane, int w)
{
HWND ctl;
RECT margin, rectc;
int staticheight, barheight;
// Determine margin sizes.
SetRect (&margin, 7, 7, 0, 0);
MapDialogRect (pane, &margin);
// Stick the message text in the upper left corner.
ctl = GetDlgItem (pane, IDC_NETSTARTMESSAGE);
GetClientRect (ctl, &rectc);
MoveWindow (ctl, margin.left, margin.top, rectc.right, rectc.bottom, TRUE);
// Stick the count text in the upper right corner.
ctl = GetDlgItem (pane, IDC_NETSTARTCOUNT);
GetClientRect (ctl, &rectc);
MoveWindow (ctl, w - rectc.right - margin.left, margin.top, rectc.right, rectc.bottom, TRUE);
staticheight = rectc.bottom;
// Stretch the progress bar to fill the entire width.
ctl = GetDlgItem (pane, IDC_NETSTARTPROGRESS);
barheight = GetSystemMetrics (SM_CYVSCROLL);
MoveWindow (ctl, margin.left, margin.top*2 + staticheight, w - margin.left*2, barheight, TRUE);
// Center the abort button underneath the progress bar.
ctl = GetDlgItem (pane, IDCANCEL);
GetClientRect (ctl, &rectc);
MoveWindow (ctl, (w - rectc.right) / 2, margin.top*3 + staticheight + barheight, rectc.right, rectc.bottom, TRUE);
return margin.top*4 + staticheight + barheight + rectc.bottom;
}
开发者ID:floverdevel,项目名称:zdoom,代码行数:33,代码来源:i_main.cpp
示例18: MapDialogRect
void CCreateEventDlg::OnInitDialog()
{
RECT r = { 43, 24, 43+211, 24+12 };
MapDialogRect(m_hwnd, &r);
m_pTaskCombo->Create(m_hwnd, r, WS_VISIBLE | WS_CHILD, WS_EX_CLIENTEDGE);
StringBuffer sbFormat(2048);
LoadString(resInstance, IDS_EVENT_TIME_FORMAT, sbFormat, 2047);
HWND hwnd = GetDlgItem(m_hwnd, IDC_CREATE_EVENT_TIME);
SendMessage(hwnd, DTM_SETFORMAT, 0, reinterpret_cast<LPARAM>(sbFormat.operator TCHAR *()));
m_picker = TimePicker::CreateTimePicker(hwnd);
SYSTEMTIME st;
GetLocalTime(&st);
if(st.wMinute % 15)
{
st.wMinute = ((st.wMinute / 15) + 1) * 15;
if(st.wMinute > 45)
{
st.wMinute = 0;
st.wHour += 1;
}
}
SendMessage(hwnd, DTM_SETSYSTEMTIME, GDT_VALID, reinterpret_cast<LPARAM>(&st));
hwnd = GetDlgItem(m_hwnd, IDC_CREATE_EVENT_EDIT_DURATION_DAYS);
m_pEstDuration = new EstDurationEdit(hwnd, false, true);
// hwnd = GetDlgItem(m_hwnd, IDC_CREATE_EVENT_EDIT_DURATION_HOURS);
// SetWindowText(hwnd, _T("1"));
}
开发者ID:jaylauffer,项目名称:loadngo,代码行数:31,代码来源:CreateEventDlg.cpp
示例19: MapDialogRect
HWND container_window::create_in_dialog_units(HWND wnd_dialog, const ui_helpers::window_position_t & p_window_position, LPVOID create_param)
{
RECT rc;
p_window_position.convert_to_rect(rc);
MapDialogRect(wnd_dialog, &rc);
return create(wnd_dialog, create_param, ui_helpers::window_position_t(rc));
}
开发者ID:GChristensen,项目名称:foo_uie_explorer_mod,代码行数:7,代码来源:window_helper.cpp
示例20: draw_joystick_axes
static void draw_joystick_axes(HWND hwnd, struct JoystickData* data)
{
int i;
HINSTANCE hinst = (HINSTANCE) GetWindowLongPtrW(hwnd, GWLP_HINSTANCE);
static const WCHAR button_class[] = {'B','u','t','t','o','n','\0'};
static const WCHAR axes_names[TEST_MAX_AXES][7] = { {'X',',','Y','\0'}, {'R','x',',','R','y','\0'},
{'Z',',','R','z','\0'}, {'P','O','V','\0'} };
static const DWORD axes_idc[TEST_MAX_AXES] = { IDC_TESTGROUPXY, IDC_TESTGROUPRXRY,
IDC_TESTGROUPZRZ, IDC_TESTGROUPPOV };
for (i = 0; i < TEST_MAX_AXES; i++)
{
RECT r;
/* Set axis box name */
SetWindowTextW(GetDlgItem(hwnd, axes_idc[i]), axes_names[i]);
r.left = (TEST_AXIS_X + TEST_NEXT_AXIS_X*i);
r.top = TEST_AXIS_Y;
r.right = r.left + TEST_AXIS_SIZE_X;
r.bottom = r.top + TEST_AXIS_SIZE_Y;
MapDialogRect(hwnd, &r);
data->graphics.axes[i] = CreateWindowW( button_class, NULL, WS_CHILD | WS_VISIBLE,
r.left, r.top, r.right - r.left, r.bottom - r.top,
hwnd, NULL, NULL, hinst);
}
}
开发者ID:PatroxGaurab,项目名称:wine,代码行数:27,代码来源:main.c
注:本文中的MapDialogRect函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论