Exemplo n.º 1
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;
	}
}
Exemplo n.º 3
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;
	}
}
Exemplo n.º 5
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;
    }
}
Exemplo n.º 6
0
LRESULT CALLBACK AP_Win32LeftRuler::_LeftRulerWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
	// this is a static member function.

	AP_Win32LeftRuler * pRuler = GWL(hwnd);

	if (!pRuler)
		return UT_DefWindowProc(hwnd, iMsg, wParam, lParam);

	GR_Win32Graphics * pG = static_cast<GR_Win32Graphics *>(pRuler->m_pG);
		
	switch (iMsg)
	{
	case WM_LBUTTONDOWN:
		SetCapture(hwnd);
		pRuler->mousePress(s_GetEMS(wParam),EV_EMB_BUTTON1,pG->tlu(LOWORD(lParam)), pG->tlu(HIWORD(lParam)));
		{
			pG->handleSetCursorMessage();
		}
		return 0;
		
	case WM_MBUTTONDOWN:
		SetCapture(hwnd);
		pRuler->mousePress(s_GetEMS(wParam),EV_EMB_BUTTON2,pG->tlu(LOWORD(lParam)),pG->tlu(HIWORD(lParam)));
		{
			pG->handleSetCursorMessage();
		}
		return 0;
		
	case WM_RBUTTONDOWN:
		SetCapture(hwnd);
		pRuler->mousePress(s_GetEMS(wParam),EV_EMB_BUTTON3,pG->tlu(LOWORD(lParam)),pG->tlu(HIWORD(lParam)));
		{
			pG->handleSetCursorMessage();
		}
		return 0;
		
	case WM_MOUSEMOVE:
		pRuler->mouseMotion(s_GetEMS(wParam),pG->tlu(signedLoWord(lParam)),pG->tlu(signedHiWord(lParam)));
		return 0;

	case WM_LBUTTONUP:
		pRuler->mouseRelease(s_GetEMS(wParam),EV_EMB_BUTTON1,pG->tlu(signedLoWord(lParam)),pG->tlu(signedHiWord(lParam)));
		ReleaseCapture();
		return 0;

	case WM_MBUTTONUP:
		pRuler->mouseRelease(s_GetEMS(wParam),EV_EMB_BUTTON2,pG->tlu(signedLoWord(lParam)),pG->tlu(signedHiWord(lParam)));
		ReleaseCapture();
		return 0;
		
	case WM_RBUTTONUP:
		pRuler->mouseRelease(s_GetEMS(wParam),EV_EMB_BUTTON3,pG->tlu(signedLoWord(lParam)),pG->tlu(signedHiWord(lParam)));
		ReleaseCapture();
		return 0;

	case WM_LBUTTONDBLCLK:
	case WM_MBUTTONDBLCLK:
	case WM_RBUTTONDBLCLK:
		return 0;

	case WM_PAINT:
		{
			PAINTSTRUCT ps;
			HDC hdc = BeginPaint(hwnd, &ps);
			UT_return_val_if_fail(hdc && pG, 0);
			UT_Rect r(ps.rcPaint.left,ps.rcPaint.top,
					  ps.rcPaint.right-ps.rcPaint.left+1,
					  ps.rcPaint.bottom-ps.rcPaint.top+1);
			pRuler->draw(&r);
			EndPaint(hwnd,&ps);
			return 0;
		}

	case WM_SYSCOLORCHANGE:
		{
			pG->init3dColors();
			return 0;
		}

	case WM_SETCURSOR:
		{
			pG->handleSetCursorMessage();
		}
		return 0;
	default:
		break;
	}

	return UT_DefWindowProc(hwnd, iMsg, wParam, lParam);
}
Exemplo n.º 7
0
LRESULT CALLBACK AP_Win32TopRuler::_TopRulerWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
	// this is a static member function.

	AP_Win32TopRuler * pRuler = GWL(hwnd);

	if (!pRuler)
		return UT_DefWindowProc(hwnd, iMsg, wParam, lParam);

	GR_Win32Graphics * pG = static_cast<GR_Win32Graphics *>(pRuler->m_pG);
		
	switch (iMsg)
	{
	case WM_LBUTTONDOWN:
		SetCapture(hwnd);
		
		pRuler->mousePress(s_GetEMS(wParam),EV_EMB_BUTTON1,pG->tlu(LOWORD(lParam)),pG->tlu(HIWORD(lParam)));
		{				
			pG->handleSetCursorMessage();
		}
		return 0;
		
	case WM_MBUTTONDOWN:
		SetCapture(hwnd);		
		pRuler->mousePress(s_GetEMS(wParam),EV_EMB_BUTTON2,pG->tlu(LOWORD(lParam)),pG->tlu(HIWORD(lParam)));
		{				
			pG->handleSetCursorMessage();
		}
		return 0;
		
	case WM_RBUTTONDOWN:		
		SetCapture(hwnd);
		pRuler->mousePress(s_GetEMS(wParam),EV_EMB_BUTTON3,
			pG->tlu(LOWORD(lParam)),pG->tlu(HIWORD(lParam)));
		{			
			pG->handleSetCursorMessage();
		}
		return 0;
		
	case WM_MOUSEMOVE:
		{
			// HACK for not updating Ruler for incremental Loading
			FV_View * pView = (FV_View *) pRuler->getView();
			if(pView && (pView->getPoint() == 0))
			{
				return 0;
			}
		}		
		pRuler->mouseMotion(s_GetEMS(wParam),pG->tlu(signedLoWord(lParam)),pG->tlu(signedHiWord(lParam)));
		pRuler->isMouseOverTab(pG->tlu(signedLoWord(lParam)),pG->tlu(signedHiWord(lParam)));
		return 0;

	case WM_LBUTTONUP:		
		pRuler->mouseRelease(s_GetEMS(wParam),EV_EMB_BUTTON1,pG->tlu(signedLoWord(lParam)),pG->tlu(signedHiWord(lParam)));
		ReleaseCapture();
		return 0;		 

	case WM_MBUTTONUP:		
		pRuler->mouseRelease(s_GetEMS(wParam),EV_EMB_BUTTON2,pG->tlu(signedLoWord(lParam)),pG->tlu(signedHiWord(lParam)));
		ReleaseCapture();
		return 0;
		
	case WM_RBUTTONUP:		
		pRuler->mouseRelease(s_GetEMS(wParam),EV_EMB_BUTTON3,pG->tlu(signedLoWord(lParam)),pG->tlu(signedHiWord(lParam)));
		ReleaseCapture();
		return 0;
	
	case WM_PAINT:
		{	
			// HACK for not updating Ruler for incremental Loading
			FV_View * pView = (FV_View *) pRuler->getView();
			if(pView && (pView->getPoint() == 0))
			{
				return 0;
			}
			PAINTSTRUCT ps;
			HDC hdc = BeginPaint(hwnd, &ps);
			UT_return_val_if_fail(hdc, 0);

			UT_Rect r(pG->tlu(ps.rcPaint.left),
					  pG->tlu(ps.rcPaint.top),
					  pG->tlu(ps.rcPaint.right-ps.rcPaint.left+1),
					  pG->tlu(ps.rcPaint.bottom-ps.rcPaint.top+1));

			pRuler->draw(&r);
			EndPaint(hwnd,&ps);
			return 0;
		}

	case WM_SYSCOLORCHANGE:
		{
			pG->init3dColors();
			return 0;
		}

	case WM_SETCURSOR:
		{
			pG->handleSetCursorMessage();
			return 0;
		}

	default:
		break;
	}

	return UT_DefWindowProc(hwnd, iMsg, wParam, lParam);
}