Example #1
0
void wxFileDialog::MSWOnInitDone(WXHWND hDlg)
{
    // note the dialog is the parent window: hDlg is a child of it when
    // OFN_EXPLORER is used
    HWND hFileDlg = ::GetParent((HWND)hDlg);

    // set HWND so that our DoMoveWindow() works correctly
    SetHWND((WXHWND)hFileDlg);

    if ( m_centreDir )
    {
        // now we have the real dialog size, remember it
        RECT rect;
        GetWindowRect(hFileDlg, &rect);
        gs_rectDialog = wxRectFromRECT(rect);

        // and position the window correctly: notice that we must use the base
        // class version as our own doesn't do anything except setting flags
        wxFileDialogBase::DoCentre(m_centreDir);
    }
    else // need to just move it to the correct place
    {
        SetPosition(gs_rectDialog.GetPosition());
    }

    // we shouldn't destroy this HWND
    SetHWND(NULL);
}
Example #2
0
void wxFileDialog::MSWOnInitDialogHook(WXHWND hwnd)
{
   SetHWND(hwnd);

   CreateExtraControl();

   SetHWND(NULL);
}
Example #3
0
RichEdit::RichEdit(HWND hwnd) :
	m_hwnd(NULL),
	m_ole(NULL),
	m_textDocument(NULL),
	m_stopped(0),
	m_undoEnabled(TRUE)
{
	SetHWND(hwnd);
}
Example #4
0
LRESULT CLogTagFilterEditDlg::OnInitDialog(HWND /*hwndFocus*/, LPARAM /*lp*/)
{
	SetDlgItemText(IDC_EDIT_LOGTAG, m_filter->m_tag.c_str());
	SetHWND(m_hWnd);
	SetStaticTextColor(IDC_STATIC_INFO1, RGB(0, 0, 255));
	SetStaticTextColor(IDC_STATIC_INFO2, RGB(0, 0, 255));
	CenterWindow();
	return 0;
}
Example #5
0
bool wxToolMenuBar::MSWCreateToolbar(const wxPoint& WXUNUSED(pos), const wxSize& WXUNUSED(size), wxMenuBar* menuBar)
{
    SetMenuBar(menuBar);
    if (m_menuBar)
        m_menuBar->SetToolBar(this);

#if defined(WINCE_WITHOUT_COMMANDBAR)
    // Create the menubar.
    SHMENUBARINFO mbi;

    memset (&mbi, 0, sizeof (SHMENUBARINFO));
    mbi.cbSize     = sizeof (SHMENUBARINFO);
    mbi.hwndParent = (HWND) GetParent()->GetHWND();
#ifdef __SMARTPHONE__
    mbi.nToolBarId = 5002;
#else
    mbi.nToolBarId = 5000;
#endif
    mbi.nBmpId     = 0;
    mbi.cBmpImages = 0;
    mbi.dwFlags = 0 ; // SHCMBF_EMPTYBAR;
    mbi.hInstRes = wxGetInstance();

    if (!SHCreateMenuBar(&mbi))
    {
        wxFAIL_MSG( _T("SHCreateMenuBar failed") );
        return false;
    }

    SetHWND((WXHWND) mbi.hwndMB);
#else
    HWND hWnd = CommandBar_Create(wxGetInstance(), (HWND) GetParent()->GetHWND(), GetId());
    SetHWND((WXHWND) hWnd);
#endif

    // install wxWidgets window proc for this window
    SubclassWin(m_hWnd);

    if (menuBar)
        menuBar->Create();

    return true;
}
Example #6
0
bool wxToolMenuBar::MSWCreateToolbar(const wxPoint& WXUNUSED(pos),
                                     const wxSize& WXUNUSED(size),
                                     wxMenuBar *menuBar)
{
    SetMenuBar(menuBar);
    if (m_menuBar)
        m_menuBar->SetToolBar(this);

    HWND hwndParent = GetHwndOf(GetParent());
    wxCHECK_MSG( hwndParent, false, wxT("should have valid parent HWND") );

#if defined(WINCE_WITHOUT_COMMANDBAR)
    // create the menubar.
    WinStruct<SHMENUBARINFO> mbi;

    mbi.hwndParent = hwndParent;
    mbi.nToolBarId = wxIDM_SHMENU;
    mbi.hInstRes = wxGetInstance();

    if ( !SHCreateMenuBar(&mbi) )
    {
        wxFAIL_MSG( wxT("SHCreateMenuBar failed") );
        return false;
    }

    SetHWND((WXHWND) mbi.hwndMB);
#else
    HWND hWnd = CommandBar_Create(wxGetInstance(), hwndParent, GetId());
    SetHWND((WXHWND) hWnd);
#endif

    // install wxWidgets window proc for this window
    SubclassWin(m_hWnd);

    if (menuBar)
        menuBar->Create();

    return true;
}
Example #7
0
void wxColourDialog::MSWOnInitDone(WXHWND hDlg)
{
    // set HWND so that our DoMoveWindow() works correctly
    SetHWND(hDlg);

    if ( m_centreDir )
    {
        // now we have the real dialog size, remember it
        RECT rect;
        ::GetWindowRect((HWND)hDlg, &rect);
        gs_rectDialog = wxRectFromRECT(rect);

        // and position the window correctly: notice that we must use the base
        // class version as our own doesn't do anything except setting flags
        wxDialog::DoCentre(m_centreDir);
    }
    else if ( m_movedWindow ) // need to just move it to the correct place
    {
        SetPosition(GetPosition());
    }

    // we shouldn't destroy hDlg, so disassociate from it
    SetHWND(NULL);
}
Example #8
0
RichEdit::~RichEdit()
{
	SetHWND(NULL);
}
Example #9
0
RichEdit::RichEdit(HWND hwnd) 
	: hwnd(NULL), ole(NULL), textDocument(NULL), stopped(0), undoEnabled(TRUE)
{
	SetHWND(hwnd);
}