예제 #1
0
HWND AP_Win32LeftRuler::createWindow(HWND hwndContainer,
									UT_uint32 left, UT_uint32 top,
									UT_uint32 height)
{
		
	XAP_Win32App * app = static_cast<XAP_Win32App *>(XAP_App::getApp());
	m_hwndLeftRuler = UT_CreateWindowEx(0, s_LeftRulerWndClassName, NULL,
									 WS_CHILD | WS_VISIBLE,
									 left, top, s_iFixedWidth, height,
									 hwndContainer, NULL, app->getInstance(), NULL);
	UT_return_val_if_fail (m_hwndLeftRuler,0);
	SWL(m_hwndLeftRuler, this);
	
	
	DELETEP(m_pG);
	GR_Win32AllocInfo ai(GetDC(m_hwndLeftRuler), m_hwndLeftRuler);
	GR_Win32Graphics * pG = (GR_Win32Graphics *)XAP_App::getApp()->newGraphics(ai);

	m_pG = pG;
	UT_return_val_if_fail (pG, 0);
	pG->init3dColors();
	
	RECT rSize;
	GetClientRect(m_hwndLeftRuler,&rSize);
	setHeight(rSize.bottom);
	setWidth(rSize.right);

	return m_hwndLeftRuler;
}
예제 #2
0
BOOL CALLBACK AP_Win32Dialog_SplitCells::s_dlgProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
    AP_Win32Dialog_SplitCells * pThis;

    switch (msg)
    {
    case WM_INITDIALOG:
        pThis = (AP_Win32Dialog_SplitCells *)lParam;
        SWL(hWnd,lParam);
        return pThis->_onInitDialog(hWnd,wParam,lParam);

    case WM_COMMAND:
        pThis = GWL(hWnd);
        return pThis->_onCommand(hWnd,wParam,lParam);

    case WM_DESTROY:
        pThis = GWL(hWnd);
        if(pThis)
            pThis->destroy();
        return 0;

    default:
        return 0;
    }
}
BOOL CALLBACK AP_Win32Dialog_Paragraph::s_tabProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
	// This is a static function.

	AP_Win32Dialog_Paragraph * pThis;

	switch (msg)
	{
	case WM_INITDIALOG:
		{
			TabParam * pTP = (TabParam *) lParam;

			// from now on, we can just remember pThis
			pThis = pTP->pThis;
			SWL(hWnd,pThis);
			return pThis->_onInitTab(hWnd,wParam,lParam);
		}

	case WM_COMMAND:
		pThis = GWL(hWnd);
		return pThis->_onCommand(hWnd,wParam,lParam);

	case WM_NOTIFY:
		pThis = GWL(hWnd);
		switch (((LPNMHDR)lParam)->code)
		{
		case UDN_DELTAPOS:		return pThis->_onDeltaPos((NM_UPDOWN *)lParam);
		default:				return 0;
		}

	default:
		return 0;
	}
}
예제 #4
0
BOOL CALLBACK AP_Win32Dialog_InsertTable::s_dlgProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
		
	AP_Win32Dialog_InsertTable * pThis;
	
	switch (msg)
	{
	case WM_INITDIALOG:
		pThis = (AP_Win32Dialog_InsertTable *)lParam;
		SWL(hWnd,lParam);
		return pThis->_onInitDialog(hWnd,wParam,lParam);

	case WM_NOTIFY:
		pThis = GWL(hWnd);
		switch (((LPNMHDR)lParam)->code)
		{
			case UDN_DELTAPOS:		return pThis->_onDeltaPos((NM_UPDOWN *)lParam);
			default:				return 0;
		}
		
	case WM_COMMAND:
		pThis = GWL(hWnd);
		return pThis->_onCommand(hWnd,wParam,lParam);
	default:
		return 0;
	}
}
BOOL CALLBACK AP_Win32Dialog_Paragraph::s_dlgProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
	// This is a static function.

	AP_Win32Dialog_Paragraph * pThis;

	switch (msg)
	{
	case WM_INITDIALOG:
		pThis = (AP_Win32Dialog_Paragraph *)lParam;
		SWL(hWnd,lParam);
		pThis->setHandle(hWnd);
		return pThis->_onInitDialog(hWnd,wParam,lParam);

	case WM_COMMAND:
		pThis = GWL(hWnd);
		return pThis->_onCommand(hWnd,wParam,lParam);

	case WM_NOTIFY:
		{
			pThis = GWL(hWnd);

			switch (((LPNMHDR) lParam)->code)
			{
			case TCN_SELCHANGING:
				{
					// TODO: validate data before leaving page
				}
				break;

			case TCN_SELCHANGE:
				{
					int iTo = TabCtrl_GetCurSel(pThis->m_hwndTab);

					// a more general solution would be better here
					ShowWindow(pThis->m_hwndSpacing, (iTo ? SW_HIDE : SW_SHOW));
					ShowWindow(pThis->m_hwndBreaks, (!iTo ? SW_HIDE : SW_SHOW));
				}
				break;

			// Process other notifications here
			default:
				break;
			}
		}
		return 0;

	default:
		return 0;
	}
}
예제 #6
0
BOOL CALLBACK AP_Win32Dialog_FormatTable::s_dlgProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
    AP_Win32Dialog_FormatTable * pThis;

    switch (msg)
    {
    case WM_INITDIALOG:
        pThis = (AP_Win32Dialog_FormatTable *)lParam;
        SWL(hWnd,lParam);
        return pThis->_onInitDialog(hWnd,wParam,lParam);

    case WM_DRAWITEM:
    {
        pThis = GWL(hWnd);
        DRAWITEMSTRUCT* dis =  (DRAWITEMSTRUCT*)lParam;

        if (dis->CtlID==AP_RID_DIALOG_FORMATTABLE_BTN_BACKCOLOR)
            pThis->m_backgButton.draw(dis);

        if (dis->CtlID==AP_RID_DIALOG_FORMATTABLE_BTN_BORDERCOLOR)
            pThis->m_borderButton.draw(dis);

        return TRUE;
    }

    case WM_DESTROY:
    {
        pThis = GWL(hWnd);
        pThis->finalize();
        return 0;
    }

    case WM_COMMAND:
        pThis = GWL(hWnd);
        return pThis->_onCommand(hWnd,wParam,lParam);
    default:
        return 0;
    }
}