?? rect.h
字號:
/*! \mainpage CRect 輔助功能
* \author nodman
* \date 2003-6-11
*/
#ifndef _RECT_H
#define _RECT_H
#include "utils.h"
/// 取得窗口的客戶區域
class client_rect: public CRect
{
public:
/// 構造函數
/// @param owner 要取得哪一個窗口的client rect
client_rect(CWnd *owner)
{
/// @see utils.h #is_window()
if( !is_window(owner) )
return;
owner->GetClientRect(this);
}
};
/// 取得窗口區域
class window_rect: public CRect
{
public:
/// 構造函數
/// @param owner 要取得哪一個窗口的window rect
window_rect(CWnd *owner)
{
if( !is_window(owner) )
return;
owner->GetWindowRect(this);
}
};
static void vcenter_rect(CRect& host, CRect& client)
{
int h = client.Height();
client.top = host.top + (host.Height()-client.Height())/2;
client.bottom = client.top + h;
}
static void hcenter_rect(CRect& host, CRect& client)
{
int w = client.Width();
client.left = host.left + (host.Width()-client.Width())/2;
client.right = client.left + w;
}
static void center_rect(CRect& host, CRect& client)
{
hcenter_rect(host, client);
vcenter_rect(host, client);
}
#endif // _RECT_H
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -