Example #1
0
void ResizeManager::Resize(int dx, int dy)
{
	::SetWindowPos(_hwnd, 0, 0, 0, _min_wnd_size.cx+dx, _min_wnd_size.cy+dy, SWP_NOMOVE|SWP_NOACTIVATE);

	ClientRect clnt_rect(_hwnd);
	HandleSize(clnt_rect.right, clnt_rect.bottom);
}
void CStateCitySoundexBrowse::OnSize(UINT nType, int cx, int cy) 
{
	CWnd ::OnSize(nType, cx, cy);
	
	if (initialized) {
		HandleSize(cx, cy);
	}
}
void CPostcodeCityBrowse::OnSize(UINT nType, int cx, int cy) 
{
	CWnd ::OnSize(nType, cx, cy);
	
	if (initialized) {
		HandleSize(cx, cy);
	}
}
void CParseAddressBrowse::OnSize(UINT nType, int cx, int cy) 
{
	CWnd ::OnSize(nType, cx, cy);
	
	if (initialized) {
		HandleSize(cx, cy);
	}
}
// WindowProc -- Dispatches and routes window messages
LRESULT cef_main_window::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message) 
    {
    case WM_CREATE:
        if (HandleCreate())
            return 0L;
        break;
    case WM_ERASEBKGND:
        if (HandleEraseBackground())
            return 1L;
        break;
    case WM_SETFOCUS:
        if (HandleSetFocus((HWND)wParam))
            return 0L;
        break;
    case WM_PAINT:
        if (HandlePaint())
            return 0L;
        break;
    case WM_GETMINMAXINFO:
        if (HandleGetMinMaxInfo((LPMINMAXINFO) lParam))
            return 0L;
        break;
    case WM_DESTROY:
        if (HandleDestroy())
            return 0L;
        break;
    case WM_CLOSE:
        if (HandleClose())
            return 0L;
        break;
    case WM_SIZE:
        if (HandleSize(wParam == SIZE_MINIMIZED))
            return 0L;
        break;
    case WM_COMMAND:
        if (HandleCommand(LOWORD(wParam)))
            return 0L;
        break;
    case WM_COPYDATA:
        if (HandleCopyData((HWND)wParam, (PCOPYDATASTRUCT)lParam))
            return 0L;
        break;
    }

    LRESULT lr = cef_host_window::WindowProc(message, wParam, lParam);

    return lr;
}
/////////////////////////////////////////////////////////////////////////////
// Crate the window and all child windows.
/////////////////////////////////////////////////////////////////////////////
void CPostcodeCityBrowse::Initialize()
{
	assert(theApp.refQueryFile != 0);

	// Postcode code input
	zipLabel.Create("Postcode:", WS_VISIBLE | WS_CHILD, CRect(0,0,0,0), this);
	zipEdit.Create(WS_VISIBLE | WS_CHILD| WS_BORDER, CRect(0,0,0,0), this, PostcodeEditID);

	// City grid
	cityGrid.Create(
		WS_VISIBLE | WS_CHILD | WS_VSCROLL | WS_HSCROLL | WS_BORDER,
		CRect(0, 0, 400, 100),
		this,
		2
	);

	cityGrid.Initialize();
	cityGrid.SetColCount(4);
	// Column headings
	cityGrid.SetStyleRange(
		CGXRange(0, 1),
		CGXStyle().SetValue("State")
	);
	cityGrid.SetStyleRange(
		CGXRange(0, 2),
		CGXStyle().SetValue("Postcode")
	);
	cityGrid.SetStyleRange(
		CGXRange(0, 3),
		CGXStyle().SetValue("Finance")
	);
	cityGrid.SetStyleRange(
		CGXRange(0, 4),
		CGXStyle().SetValue("City")
	);
	cityGrid.GetParam()->EnableUndo(FALSE);


	cityGridLabel.Create("CityStatePostcode", WS_VISIBLE | WS_CHILD, CRect(0,0,0,0), this);

	initialized = true;

	// Cause initial placement to happen
	CRect rect;
	GetClientRect(rect);
	HandleSize(rect.right, rect.bottom);
}
/////////////////////////////////////////////////////////////////////////////
// Crate the window and all child windows.
/////////////////////////////////////////////////////////////////////////////
void CStateCitySoundexBrowse::Initialize()
{
	assert(theApp.refQueryFile != 0);

	// grid
	grid.Create(
		WS_VISIBLE | WS_CHILD | WS_VSCROLL | WS_HSCROLL | WS_BORDER,
		CRect(0, 0, 400, 100),
		this,
		2
	);
	grid.Initialize(refQueryFileRef);
	grid.GetParam()->EnableUndo(FALSE);

	initialized = true;

	// Cause initial placement to happen
	CRect rect;
	GetClientRect(rect);
	HandleSize(rect.right, rect.bottom);
}
Example #8
0
WXLRESULT wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
    WXLRESULT rc = 0;
    bool processed = false;

    switch ( message )
    {
        case WM_CLOSE:
            // if we can't close, tell the system that we processed the
            // message - otherwise it would close us
            processed = !Close();
            break;

        case WM_SIZE:
            processed = HandleSize(LOWORD(lParam), HIWORD(lParam), wParam);
            break;

        case WM_COMMAND:
            {
                WORD id, cmd;
                WXHWND hwnd;
                UnpackCommand((WXWPARAM)wParam, (WXLPARAM)lParam,
                              &id, &hwnd, &cmd);

                HandleCommand(id, cmd, (WXHWND)hwnd);

                // don't pass WM_COMMAND to the base class whether we processed
                // it or not because we did generate an event for it (our
                // HandleCommand() calls the base class version) and we must
                // not do it again or the handlers which skip the event would
                // be called twice
                processed = true;
            }
            break;

        case WM_INITMENUPOPUP:
        case WM_UNINITMENUPOPUP:
            // We get these messages from the menu bar even if the menu is
            // disabled, which is unexpected, so ignore them in this case.
            if ( wxMenuBar* mbar = GetMenuBar() )
            {
                const int pos = mbar->MSWGetTopMenuPos((WXHMENU)wParam);
                if ( pos != wxNOT_FOUND && !mbar->IsEnabledTop(pos) )
                {
                    // This event comes from a disabled top level menu, don't
                    // handle it.
                    return MSWDefWindowProc(message, wParam, lParam);
                }
            }
            break;

        case WM_QUERYDRAGICON:
            {
                const wxIcon& icon = GetIcon();
                HICON hIcon = icon.IsOk() ? GetHiconOf(icon)
                                        : (HICON)GetDefaultIcon();
                rc = (WXLRESULT)hIcon;
                processed = rc != 0;
            }
            break;
    }
#if wxUSE_TASKBARBUTTON
    if ( message == wxMsgTaskbarButtonCreated )
    {
        if ( m_taskBarButton )
            m_taskBarButton->Realize();

        processed = true;
    }
#endif

    if ( !processed )
        rc = wxFrameBase::MSWWindowProc(message, wParam, lParam);

    return rc;
}
Example #9
0
MRESULT wxFrame::OS2WindowProc( WXUINT uMessage,
                                WXWPARAM wParam,
                                WXLPARAM lParam )
{
    MRESULT mRc = 0L;
    bool    bProcessed = false;

    switch (uMessage)
    {
        case WM_CLOSE:
            //
            // If we can't close, tell the system that we processed the
            // message - otherwise it would close us
            //
            bProcessed = !Close();
            break;

        case WM_PAINT:
            bProcessed = HandlePaint();
            mRc = (MRESULT)FALSE;
            break;

         case WM_ERASEBACKGROUND:
            //
            // Returning TRUE to requests PM to paint the window background
            // in SYSCLR_WINDOW. We capture this here because the PS returned
            // in Frames is the PS for the whole frame, which we can't really
            // use at all. If you want to paint a different background, do it
            // in an OnPaint using a wxPaintDC.
            //
            mRc = (MRESULT)(TRUE);
            break;

      case WM_COMMAND:
            {
                WORD                wId;
                WORD                wCmd;
                WXHWND              hWnd;

                UnpackCommand( (WXWPARAM)wParam
                              ,(WXLPARAM)lParam
                              ,&wId
                              ,&hWnd
                              ,&wCmd
                             );

                bProcessed = HandleCommand( wId
                                           ,wCmd
                                           ,(WXHWND)hWnd
                                          );
            }
            break;

        case WM_MENUSELECT:
            {
                WXWORD              wItem;
                WXWORD              wFlags;
                WXHMENU             hMenu;

                UnpackMenuSelect( wParam
                                 ,lParam
                                 ,&wItem
                                 ,&wFlags
                                 ,&hMenu
                                );
                bProcessed = HandleMenuSelect( wItem
                                              ,wFlags
                                              ,hMenu
                                             );
                mRc = (MRESULT)TRUE;
            }
            break;

        case WM_SIZE:
            {
                SHORT               nScxnew = SHORT1FROMMP(lParam); // New horizontal size.
                SHORT               nScynew = SHORT2FROMMP(lParam); // New vertical size.

                lParam = MRFROM2SHORT( nScxnew - 20
                                      ,nScynew - 30
                                     );
            }
            bProcessed = HandleSize(LOWORD(lParam), HIWORD(lParam), (WXUINT)wParam);
            mRc = (MRESULT)FALSE;
            break;

        case CM_QUERYDRAGIMAGE:
            {
                const wxIcon&           vIcon = GetIcon();
                HPOINTER                hIcon;

                if (vIcon.Ok())
                    hIcon = (HPOINTER)::WinSendMsg(GetHWND(), WM_QUERYICON, 0L, 0L);
                else
                    hIcon = (HPOINTER)m_hDefaultIcon;
                mRc = (MRESULT)hIcon;
                bProcessed = mRc != 0;
            }
            break;
    }

    if (!bProcessed )
        mRc = wxWindow::OS2WindowProc( uMessage
                                      ,wParam
                                      ,lParam
                                     );
    return (MRESULT)mRc;
} // wxFrame::OS2WindowProc
Example #10
0
WXLRESULT wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
    WXLRESULT rc = 0;
    bool processed = false;

    switch ( message )
    {
        case WM_CLOSE:
            // if we can't close, tell the system that we processed the
            // message - otherwise it would close us
            processed = !Close();
            break;

        case WM_SIZE:
            processed = HandleSize(LOWORD(lParam), HIWORD(lParam), wParam);
            break;

        case WM_COMMAND:
            {
                WORD id, cmd;
                WXHWND hwnd;
                UnpackCommand((WXWPARAM)wParam, (WXLPARAM)lParam,
                              &id, &hwnd, &cmd);

                HandleCommand(id, cmd, (WXHWND)hwnd);

                // don't pass WM_COMMAND to the base class whether we processed
                // it or not because we did generate an event for it (our
                // HandleCommand() calls the base class version) and we must
                // not do it again or the handlers which skip the event would
                // be called twice
                processed = true;
            }
            break;

#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
#if wxUSE_MENUS
        case WM_INITMENUPOPUP:
            processed = HandleInitMenuPopup((WXHMENU) wParam);
            break;

        case WM_MENUSELECT:
            {
                WXWORD item, flags;
                WXHMENU hmenu;
                UnpackMenuSelect(wParam, lParam, &item, &flags, &hmenu);

                processed = HandleMenuSelect(item, flags, hmenu);
            }
            break;

        case WM_EXITMENULOOP:
            processed = HandleMenuLoop(wxEVT_MENU_CLOSE, (WXWORD)wParam);
            break;
#endif // wxUSE_MENUS

        case WM_QUERYDRAGICON:
            {
                const wxIcon& icon = GetIcon();
                HICON hIcon = icon.IsOk() ? GetHiconOf(icon)
                                        : (HICON)GetDefaultIcon();
                rc = (WXLRESULT)hIcon;
                processed = rc != 0;
            }
            break;
#endif // !__WXMICROWIN__
    }

    if ( !processed )
        rc = wxFrameBase::MSWWindowProc(message, wParam, lParam);

    return rc;
}
Example #11
0
File: frame.cpp Project: EdgarTx/wx
WXLRESULT wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
    WXLRESULT rc = 0;
    bool processed = false;

    switch ( message )
    {
        case WM_CLOSE:
            // if we can't close, tell the system that we processed the
            // message - otherwise it would close us
            processed = !Close();
            break;

        case WM_SIZE:
            processed = HandleSize(LOWORD(lParam), HIWORD(lParam), wParam);
            break;

        case WM_COMMAND:
            {
                WORD id, cmd;
                WXHWND hwnd;
                UnpackCommand((WXWPARAM)wParam, (WXLPARAM)lParam,
                              &id, &hwnd, &cmd);

                processed = HandleCommand(id, cmd, (WXHWND)hwnd);
            }
            break;

        case WM_PAINT:
            processed = HandlePaint();
            break;

        case WM_INITMENUPOPUP:
            processed = HandleInitMenuPopup((WXHMENU) wParam);
            break;

#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
        case WM_MENUSELECT:
            {
                WXWORD item, flags;
                WXHMENU hmenu;
                UnpackMenuSelect(wParam, lParam, &item, &flags, &hmenu);

                processed = HandleMenuSelect(item, flags, hmenu);
            }
            break;

        case WM_EXITMENULOOP:
            processed = HandleMenuLoop(wxEVT_MENU_CLOSE, (WXWORD)wParam);
            break;

        case WM_QUERYDRAGICON:
            {
                const wxIcon& icon = GetIcon();
                HICON hIcon = icon.Ok() ? GetHiconOf(icon)
                                        : (HICON)GetDefaultIcon();
                rc = (long)hIcon;
                processed = rc != 0;
            }
            break;
#endif // !__WXMICROWIN__
    }

    if ( !processed )
        rc = wxFrameBase::MSWWindowProc(message, wParam, lParam);

    return rc;
}
/////////////////////////////////////////////////////////////////////////////
// Crate the window and all child windows.
/////////////////////////////////////////////////////////////////////////////
void CParseAddressBrowse::Initialize()
{
	assert(theApp.refQueryFile != 0);

	// First line
	firstLineLabel.Create("First Line:", WS_VISIBLE | WS_CHILD, CRect(0,0,0,0), this);
	firstLineEdit.Create(WS_VISIBLE | WS_CHILD| WS_BORDER, CRect(0,0,0,0), this, FirstLineEditID);

	// Last line
	lastLineLabel.Create("Last Line:", WS_VISIBLE | WS_CHILD, CRect(0,0,0,0), this);
	lastLineEdit.Create(WS_VISIBLE | WS_CHILD| WS_BORDER, CRect(0,0,0,0), this, LastLineEditID);

	// Parse Button
	parseButton.Create("Parse", WS_VISIBLE | WS_CHILD| WS_BORDER, CRect(0,0,0,0), this, ParseButtonID);

	// first line parse grid
	firstLineParseGrid.Create(
		WS_VISIBLE | WS_CHILD | WS_VSCROLL | WS_HSCROLL | WS_BORDER,
		CRect(0, 0, 400, 100),
		this,
		10
	);
	firstLineParseGrid.Initialize();
	firstLineParseGrid.SetColCount(NbrColumns);
	// Column headings
	firstLineParseGrid.SetStyleRange(
		CGXRange(0, NbrColumn),
		CGXStyle().SetValue("Nbr")
	);
	firstLineParseGrid.SetStyleRange(
		CGXRange(0, PredirColumn),
		CGXStyle().SetValue("Predir")
	);
	firstLineParseGrid.SetStyleRange(
		CGXRange(0, PrefixColumn),
		CGXStyle().SetValue("Prefix")
	);
	firstLineParseGrid.SetStyleRange(
		CGXRange(0, StreetColumn),
		CGXStyle().SetValue("Street")
	);
	firstLineParseGrid.SetStyleRange(
		CGXRange(0, SuffixColumn),
		CGXStyle().SetValue("Suffix")
	);
	firstLineParseGrid.SetStyleRange(
		CGXRange(0, PostdirColumn),
		CGXStyle().SetValue("Postdir")
	);
	firstLineParseGrid.SetStyleRange(
		CGXRange(0, UnitDesColumn),
		CGXStyle().SetValue("UnitDes")
	);
	firstLineParseGrid.SetStyleRange(
		CGXRange(0, UnitColumn),
		CGXStyle().SetValue("Unit")
	);
	firstLineParseGrid.SetStyleRange(
		CGXRange(0, IntersectColumn),
		CGXStyle().SetValue("Intersect?")
	);
	firstLineParseGrid.SetStyleRange(
		CGXRange(0, Street2Column),
		CGXStyle().SetValue("Street2")
	);
	firstLineParseGrid.SetStyleRange(
		CGXRange(0, ModsColumn),
		CGXStyle().SetValue("Mods")
	);
	firstLineParseGridLabel.Create("First Line Parse Candidates", WS_VISIBLE | WS_CHILD, CRect(0,0,0,0), this);


	// last line parse grid
	lastLineParseGrid.Create(
		WS_VISIBLE | WS_CHILD | WS_VSCROLL | WS_HSCROLL | WS_BORDER,
		CRect(0, 0, 400, 100),
		this,
		10
	);
	lastLineParseGrid.Initialize();
	lastLineParseGrid.SetColCount(5);
	// Column headings
	lastLineParseGrid.SetStyleRange(
		CGXRange(0, 1),
		CGXStyle().SetValue("City")
	);
	lastLineParseGrid.SetStyleRange(
		CGXRange(0, 2),
		CGXStyle().SetValue("State")
	);
	lastLineParseGrid.SetStyleRange(
		CGXRange(0, 3),
		CGXStyle().SetValue("Postcode")
	);
	lastLineParseGrid.SetStyleRange(
		CGXRange(0, 4),
		CGXStyle().SetValue("Pcode Ext")
	);
	lastLineParseGrid.SetStyleRange(
		CGXRange(0, 5),
		CGXStyle().SetValue("Mods")
	);
	lastLineParseGridLabel.Create("Last Line Parse Candidates", WS_VISIBLE | WS_CHILD, CRect(0,0,0,0), this);

	initialized = true;

	// Cause initial placement to happen
	CRect rect;
	GetClientRect(rect);
	HandleSize(rect.right, rect.bottom);
}