Пример #1
0
void GUIAPI DisabledTextOut (HDC hDC, int x, int y, const char* szText)
{
    SetBkMode (hDC, BM_TRANSPARENT);
    SetTextColor (hDC, GetWindowElementColor (WEC_3DFRAME_LEFT));
    TextOut (hDC, x + 1, y + 1, szText);
    SetTextColor (hDC, GetWindowElementColor (WEC_3DFRAME_RIGHT));
    TextOut (hDC, x, y, szText);
}
Пример #2
0
void GUIAPI Draw3DBorder (HDC hdc, int l, int t, int r, int b)
{
    SetPenColor(hdc, GetWindowElementColor (WEC_3DFRAME_LEFT));
    Rectangle (hdc, l + 1, t + 1, r - 1, b - 1);

    SetPenColor(hdc, GetWindowElementColor (WEC_3DFRAME_RIGHT));
    Rectangle (hdc, l, t, r - 2, b - 2);
}
Пример #3
0
void GUIAPI Draw3DDownThinFrame (HDC hDC, int l, int t, int r, int b, gal_pixel fillc)
{
    SetPenColor(hDC, GetWindowElementColor (WEC_3DFRAME_LEFT));
    MoveTo(hDC, l, b);
    LineTo(hDC, r, b);
    LineTo(hDC, r, t);
    SetPenColor(hDC, GetWindowElementColor (WEC_3DFRAME_RIGHT));
    MoveTo(hDC, l, b);
    LineTo(hDC, l, t);
    LineTo(hDC, r, t);

    if (fillc != 0) {
         SetBrushColor(hDC, fillc);
         FillBox(hDC, l + 1, t + 1, r - l - 2, b - t - 2);
    }
}
Пример #4
0
BOOL RegisterSpinControl (void)
{
    WNDCLASS WndClass;

#ifdef _PHONE_WINDOW_STYLE
    if ((bmp_spinbox_v = GetStockBitmap (STOCKBMP_SPINBOX_VERT, 0, 0)) == NULL)
        return FALSE;

    if ((bmp_spinbox_h = GetStockBitmap (STOCKBMP_SPINBOX_HORZ, 0, 0)) == NULL)
        return FALSE;
#else
    if ((bmp_spinbox_v = GetStockBitmap (STOCKBMP_SPINBOX_VERT, -1, -1)) == NULL)
        return FALSE;

    if ((bmp_spinbox_h = GetStockBitmap (STOCKBMP_SPINBOX_HORZ, -1, -1)) == NULL)
        return FALSE;
#endif
    WndClass.spClassName = CTRL_SPINBOX;
    WndClass.dwStyle     = WS_NONE;
    WndClass.dwExStyle   = WS_EX_NONE;
    WndClass.hCursor     = GetSystemCursor (IDC_ARROW);
    WndClass.iBkColor    = GetWindowElementColor (BKC_CONTROL_DEF);
    WndClass.WinProc     = SpinCtrlProc;

    return RegisterWindowClass (&WndClass);
}
Пример #5
0
int net_3gadd(HWND Wnd)
{
	MSG           Msg;
	MAINWINCREATE CreateInfo;
	HWND          MPlayerWnd;
        PMAINWIN2 pWin;  //channing	
	
	
	fWnd = Wnd;

    
#if _DEBUG
        pWin2 = (PMAINWIN2)Wnd;
        printf ("net_3gadd\n");        
        printf ("pWin=0x%p \n",pWin2);
        printf ("fWnd=0x%p \n",fWnd);        
        printf ("pWin->WinType=0x%x\n",pWin2->DataType);        
        printf ("pWin->WinType=0x%x\n",pWin2->WinType);
#endif 
        


	CreateInfo.dwStyle        = WS_CAPTION | WS_BORDER | WS_VISIBLE;
	CreateInfo.dwExStyle      = WS_EX_NONE;
	CreateInfo.spCaption      = MSG_ADD_FILE;
	CreateInfo.hMenu          = 0;
	CreateInfo.hCursor        = GetSystemCursor(IDC_ARROW);
	CreateInfo.hIcon          = 0;
	CreateInfo.MainWindowProc = Desktop;
	CreateInfo.lx             = 0;
	CreateInfo.ty             = 0;
	CreateInfo.rx             = 320;
	CreateInfo.by             = 210;
	CreateInfo.iBkColor       = GetWindowElementColor(BKC_CONTROL_DEF);
	CreateInfo.dwAddData      = 0;
	CreateInfo.dwReserved     = 0;
	CreateInfo.hHosting       = 0;

	MPlayerWnd = CreateMainWindow(&CreateInfo);
	if (MPlayerWnd == HWND_INVALID) {
		return -1;
	}

	ShowWindow(MPlayerWnd, SW_SHOWNORMAL);

	while (GetMessage(&Msg, MPlayerWnd)) {
		TranslateMessage(&Msg);
		DispatchMessage(&Msg);
	}

	MainWindowThreadCleanup(MPlayerWnd);
	return 0;
}
Пример #6
0
BOOL RegisterProgressBarControl (void)
{
    WNDCLASS WndClass;

    WndClass.spClassName = CTRL_PROGRESSBAR;
    WndClass.dwStyle     = WS_NONE;
    WndClass.dwExStyle   = WS_EX_NONE;
    WndClass.hCursor     = GetSystemCursor (0);
    WndClass.iBkColor    = GetWindowElementColor (BKC_CONTROL_DEF);
    WndClass.WinProc     = ProgressBarCtrlProc;

    return AddNewControlClass (&WndClass) == ERR_OK;
}
Пример #7
0
static BOOL RegisterContainer (void)
{
    WNDCLASS WndClass;

    WndClass.spClassName = CTRL_CONTAINER;
    WndClass.dwStyle     = WS_NONE;
    WndClass.dwExStyle   = WS_EX_NONE;
    WndClass.hCursor     = GetSystemCursor (IDC_ARROW);
    WndClass.iBkColor    = GetWindowElementColor (BKC_CONTROL_DEF);
    WndClass.WinProc     = DefaultContainerProc;

    return AddNewControlClass (&WndClass) == ERR_OK;
}
Пример #8
0
BOOL RegisterAnimationControl (void)
{
    WNDCLASS WndClass;

    WndClass.spClassName = CTRL_ANIMATION;
    WndClass.dwStyle     = WS_NONE;
    WndClass.dwExStyle   = WS_EX_NONE;
    WndClass.hCursor     = GetSystemCursor (IDC_ARROW);
    WndClass.iBkColor    = GetWindowElementColor (BKC_CONTROL_DEF);
    WndClass.WinProc     = AnimationCtrlProc;

    return RegisterWindowClass (&WndClass);
}
Пример #9
0
/****************************** Drawing Helpers *******************************/
void GUIAPI Draw3DUpFrame(HDC hDC, int l, int t, int r, int b, gal_pixel fillc)
{
    r--;
    b--;

    SetPenColor(hDC, GetWindowElementColor (WEC_3DFRAME_RIGHT_INNER));
    Rectangle(hDC, l, t, r, b);
    SetPenColor(hDC, GetWindowElementColor (WEC_3DFRAME_LEFT_INNER));
    Rectangle(hDC, l, t, r - 1, b - 1);
    SetPenColor(hDC, GetWindowElementColor (WEC_3DFRAME_LEFT_OUTER));
    MoveTo(hDC, l, b);
    LineTo(hDC, r, b);
    LineTo(hDC, r, t);
    SetPenColor(hDC, GetWindowElementColor (WEC_3DFRAME_RIGHT_OUTER));
    MoveTo(hDC, l + 1, b - 1);
    LineTo(hDC, l + 1, t + 1);
    LineTo(hDC, r - 1, t + 1); 

    if (fillc != 0) {
         SetBrushColor(hDC, fillc);
         FillBox(hDC, l + 2, t + 2, r - l - 3, b - t - 3);
    }
}
Пример #10
0
BOOL RegisterButtonControl (void)
{
    WNDCLASS WndClass;

    if (!LoadSystemBitmap (&bmp_button, SYSBMP_BUTTON))
        return FALSE;

    WndClass.spClassName = CTRL_BUTTON;
    WndClass.dwStyle     = WS_NONE;
    WndClass.dwExStyle   = WS_EX_NONE;
    WndClass.hCursor     = GetSystemCursor (IDC_ARROW);
    WndClass.iBkColor    = GetWindowElementColor (BKC_CONTROL_DEF);
    WndClass.WinProc     = ButtonCtrlProc;

    return AddNewControlClass (&WndClass) == ERR_OK;
}
Пример #11
0
BOOL RegisterScrollWndControl (void)
{
    WNDCLASS WndClass;

    if (!RegisterContainer ())
        return FALSE;

    WndClass.spClassName = CTRL_SCROLLWND;
    WndClass.dwStyle     = WS_NONE;
    WndClass.dwExStyle   = WS_EX_NONE;
    WndClass.hCursor     = GetSystemCursor (IDC_ARROW);
    WndClass.iBkColor    = GetWindowElementColor (BKC_CONTROL_DEF);
    WndClass.WinProc     = ScrollWndCtrlProc;

    return AddNewControlClass (&WndClass) == ERR_OK;
}
static void InitCreateInfo(PMAINWINCREATE pCreateInfo)
{
    pCreateInfo->dwStyle = WS_CAPTION | WS_BORDER|WS_VISIBLE;  
    pCreateInfo->dwExStyle = WS_EX_IMECOMPOSE;
    pCreateInfo->spCaption = CoolBar_control;
    pCreateInfo->hMenu = 0;
    pCreateInfo->hCursor = GetSystemCursor(0);
    pCreateInfo->hIcon = 0;
    pCreateInfo->MainWindowProc = ControlTestWinProc;
    pCreateInfo->lx = 0; 
    pCreateInfo->ty = 0;
    pCreateInfo->rx = 400;
    pCreateInfo->by = 300;
    pCreateInfo->iBkColor = GetWindowElementColor (WE_MAINC_THREED_BODY);
    pCreateInfo->dwAddData = 0;
    pCreateInfo->hHosting = HWND_DESKTOP;
}
Пример #13
0
int KeyBoard (HWND hWnd)
{
	MSG           Msg;
	HWND          hKB;
	MAINWINCREATE CreateInfo;

	if (!InitMiniGUIExt()) {
		return 2;
	}

	//設置鍵盤窗口屬性
	CreateInfo.dwStyle        = WS_VISIBLE | WS_THINFRAME;
	CreateInfo.dwExStyle      = WS_EX_TOPMOST | WS_EX_TOOLWINDOW;
	CreateInfo.spCaption      = "  ";
	CreateInfo.hMenu          = 0;
	CreateInfo.hCursor        = GetSystemCursor(IDC_ARROW);
	CreateInfo.hIcon          = 0;
	CreateInfo.MainWindowProc = KeyBoardPro;
	CreateInfo.lx             = 145;
	CreateInfo.ty             = 121;
	CreateInfo.rx             = 320;
	CreateInfo.by             = 215;
	CreateInfo.iBkColor       = GetWindowElementColor(BKC_CONTROL_DEF);
	CreateInfo.dwAddData      = 0;
	CreateInfo.dwReserved     = 0;
	CreateInfo.hHosting       = hWnd;

	//創建鍵盤窗口
	hKB = CreateMainWindow(&CreateInfo);
	if (hKB == HWND_INVALID) {
		return -1;
	}

	//顯示鍵盤窗口
	ShowWindow(hKB, SW_SHOWNORMAL);

	while (GetMessage(&Msg, hKB)) {
		TranslateMessage(&Msg);
		DispatchMessage(&Msg);
	}

	MiniGUIExtCleanUp();
	MainWindowThreadCleanup(hKB);
	return 0;
}
static void
InitCreateInfo (PMAINWINCREATE pCreateInfo)
{
    pCreateInfo->dwStyle = WS_CAPTION | WS_BORDER | WS_VISIBLE;
    pCreateInfo->dwExStyle = WS_EX_NONE;
    pCreateInfo->spCaption = "Grid control";
    pCreateInfo->hMenu = 0;
    pCreateInfo->hCursor = GetSystemCursor (1);
    pCreateInfo->hIcon = 0;
    pCreateInfo->MainWindowProc = ControlTestWinProc;
    pCreateInfo->lx = 0;
    pCreateInfo->ty = 0;
    pCreateInfo->rx = 500;
    pCreateInfo->by = 350;
    pCreateInfo->iBkColor = GetWindowElementColor (BKC_CONTROL_DEF); 
    pCreateInfo->dwAddData = 0;
    pCreateInfo->hHosting = HWND_DESKTOP;
}
Пример #15
0
void* start_cont_win (void* data)
{
    MSG Msg;
    MAINWINCREATE CreateInfo;
    HWND cont_hwnd;
    CONTAINER_INFO* cont_info = (CONTAINER_INFO*)data;

    CreateInfo.dwStyle = WS_ABSSCRPOS | WS_VISIBLE;
    CreateInfo.dwExStyle = WS_EX_TOOLWINDOW | WS_EX_TOPMOST;
    CreateInfo.spCaption = "";
    CreateInfo.hMenu = 0;
    CreateInfo.hCursor = GetSystemCursor(0);
    CreateInfo.hIcon = 0;

    CreateInfo.MainWindowProc = mgi_container_win_proc;
    CreateInfo.lx = g_rcScr.right-CONT_WIN_WIDTH-20;
    CreateInfo.rx = g_rcScr.right-20;
    CreateInfo.ty = 0;
    CreateInfo.by = CONT_WIN_HEIGHT;
    CreateInfo.iBkColor = GetWindowElementColor(WE_THREED_BODY);
    CreateInfo.hHosting = HWND_DESKTOP;

    cont_hwnd = cont_info->hwnd = CreateMainWindow (&CreateInfo);
    sem_post (&cont_info->wait);

    if (cont_hwnd == HWND_INVALID)
        return NULL;

    while (GetMessage (&Msg, cont_hwnd) ) {
        TranslateMessage (&Msg);
        DispatchMessage(&Msg);
    }

    MainWindowThreadCleanup (cont_hwnd);
    return NULL;

}
Пример #16
0
BOOL RegisterButtonControl (void)
{
    WNDCLASS WndClass;

#ifdef _PHONE_WINDOW_STYLE
    if ((bmp_button = GetStockBitmap (STOCKBMP_BUTTON, 0, 0)) == NULL)
    {
        printf("GetStockBitmap failure! STOCKBMP_BUTTON\n");
        return FALSE;
    }
#else
    if ((bmp_button = GetStockBitmap (STOCKBMP_BUTTON, -1, -1)) == NULL)
        return FALSE;
#endif

    WndClass.spClassName = CTRL_BUTTON;
    WndClass.dwStyle     = WS_NONE;
    WndClass.dwExStyle   = WS_EX_NONE;
    WndClass.hCursor     = GetSystemCursor (IDC_ARROW);
    WndClass.iBkColor    = GetWindowElementColor (BKC_CONTROL_DEF); 
    WndClass.WinProc     = ButtonCtrlProc;

    return AddNewControlClass (&WndClass) == ERR_OK;
}
Пример #17
0
HWND create_container_win ()
{
    MAINWINCREATE CreateInfo;
    HWND cont_hwnd;

    CreateInfo.dwStyle = WS_ABSSCRPOS | WS_VISIBLE;
    CreateInfo.dwExStyle = WS_EX_TOOLWINDOW | WS_EX_TOPMOST;
    CreateInfo.spCaption = "";
    CreateInfo.hMenu = 0;
    CreateInfo.hCursor = GetSystemCursor(0);
    CreateInfo.hIcon = 0;

    CreateInfo.MainWindowProc = mgi_container_win_proc;
    CreateInfo.lx = g_rcScr.right-CONT_WIN_WIDTH-20;
    CreateInfo.rx = g_rcScr.right-20;
    CreateInfo.ty = 0;
    CreateInfo.by = CONT_WIN_HEIGHT;
    CreateInfo.iBkColor = GetWindowElementColor(WE_THREED_BODY);
    CreateInfo.hHosting = HWND_DESKTOP;

    cont_hwnd = CreateMainWindow (&CreateInfo);

    return cont_hwnd;
}