wxPopupWindow for wxMGL
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11771 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
35
include/wx/mgl/popupwin.h
Normal file
35
include/wx/mgl/popupwin.h
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/mgl/popupwin.h
|
||||||
|
// Purpose: wxPopupWindow class for wxMGL
|
||||||
|
// Author: Vadim Zeitlin
|
||||||
|
// Created: 06.01.01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_POPUPWIN_H_
|
||||||
|
#define _WX_POPUPWIN_H_
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxPopupWindow
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxPopupWindow : public wxPopupWindowBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxPopupWindow() { }
|
||||||
|
|
||||||
|
wxPopupWindow(wxWindow *parent) { (void)Create(parent); }
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, int flags = wxBORDER_NONE)
|
||||||
|
{
|
||||||
|
return wxPopupWindowBase::Create(parent) &&
|
||||||
|
wxWindow::Create(parent, -1,
|
||||||
|
wxDefaultPosition, wxDefaultSize,
|
||||||
|
flags & wxBORDER_MASK);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_POPUPWIN_H_
|
||||||
|
|
@@ -55,6 +55,8 @@ public:
|
|||||||
#include "wx/msw/popupwin.h"
|
#include "wx/msw/popupwin.h"
|
||||||
#elif __WXGTK__
|
#elif __WXGTK__
|
||||||
#include "wx/gtk/popupwin.h"
|
#include "wx/gtk/popupwin.h"
|
||||||
|
#elif __WXMGL__
|
||||||
|
#include "wx/mgl/popupwin.h"
|
||||||
#else
|
#else
|
||||||
#error "wxPopupWindow is not supported under this platform."
|
#error "wxPopupWindow is not supported under this platform."
|
||||||
#endif
|
#endif
|
||||||
|
@@ -166,7 +166,7 @@ void wxDestroyMGL_WM()
|
|||||||
static void wxWindowPainter(window_t *wnd, MGLDC *dc)
|
static void wxWindowPainter(window_t *wnd, MGLDC *dc)
|
||||||
{
|
{
|
||||||
wxWindowMGL *w = (wxWindow*) wnd->userData;
|
wxWindowMGL *w = (wxWindow*) wnd->userData;
|
||||||
if (w && !(w->GetStyle() & wxTRANSPARENT_WINDOW))
|
if ( w && !(w->GetWindowStyle() & wxTRANSPARENT_WINDOW) )
|
||||||
{
|
{
|
||||||
MGLDevCtx ctx(dc);
|
MGLDevCtx ctx(dc);
|
||||||
w->HandlePaint(&ctx);
|
w->HandlePaint(&ctx);
|
||||||
@@ -377,6 +377,8 @@ static long wxScanToKeyCode(event_t *event)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef KEY
|
||||||
|
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,7 +389,6 @@ static long wxAsciiToKeyCode(event_t *event)
|
|||||||
|
|
||||||
static ibool wxWindowKeybHandler(window_t *wnd, event_t *e)
|
static ibool wxWindowKeybHandler(window_t *wnd, event_t *e)
|
||||||
{
|
{
|
||||||
wxEventType type = wxEVT_NULL;
|
|
||||||
wxWindowMGL *win = (wxWindowMGL*)MGL_wmGetWindowUserData(wnd);
|
wxWindowMGL *win = (wxWindowMGL*)MGL_wmGetWindowUserData(wnd);
|
||||||
|
|
||||||
if ( !win->IsEnabled() ) return FALSE;
|
if ( !win->IsEnabled() ) return FALSE;
|
||||||
@@ -516,22 +517,11 @@ bool wxWindowMGL::Create(wxWindow *parent,
|
|||||||
long style,
|
long style,
|
||||||
const wxString& name)
|
const wxString& name)
|
||||||
{
|
{
|
||||||
// FIXME_MGL -- temporary!
|
|
||||||
//wxCHECK_MSG( parent, FALSE, wxT("can't create wxWindow without parent") );
|
|
||||||
|
|
||||||
if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
|
if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if ( parent ) // FIXME_MGL temporary
|
if ( parent )
|
||||||
parent->AddChild(this);
|
parent->AddChild(this);
|
||||||
else
|
|
||||||
m_isShown=FALSE;// FIXME_MGL -- temporary, simulates wxTLW/wxFrame
|
|
||||||
|
|
||||||
if ( style & wxPOPUP_WINDOW )
|
|
||||||
{
|
|
||||||
// it is created hidden as other top level windows
|
|
||||||
m_isShown = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
x = pos.x, y = pos.y;
|
x = pos.x, y = pos.y;
|
||||||
@@ -543,10 +533,21 @@ bool wxWindowMGL::Create(wxWindow *parent,
|
|||||||
h = HeightDefault(size.y);
|
h = HeightDefault(size.y);
|
||||||
|
|
||||||
long mgl_style = 0;
|
long mgl_style = 0;
|
||||||
|
|
||||||
if ( !(style & wxNO_FULL_REPAINT_ON_RESIZE) )
|
if ( !(style & wxNO_FULL_REPAINT_ON_RESIZE) )
|
||||||
|
{
|
||||||
mgl_style |= MGL_WM_FULL_REPAINT_ON_RESIZE;
|
mgl_style |= MGL_WM_FULL_REPAINT_ON_RESIZE;
|
||||||
|
}
|
||||||
if ( style & wxSTAY_ON_TOP )
|
if ( style & wxSTAY_ON_TOP )
|
||||||
|
{
|
||||||
mgl_style |= MGL_WM_ALWAYS_ON_TOP;
|
mgl_style |= MGL_WM_ALWAYS_ON_TOP;
|
||||||
|
}
|
||||||
|
if ( style & wxPOPUP_WINDOW )
|
||||||
|
{
|
||||||
|
mgl_style |= MGL_WM_ALWAYS_ON_TOP;
|
||||||
|
// it is created hidden as other top level windows
|
||||||
|
m_isShown = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
m_wnd = MGL_wmCreateWindow(g_winMng,
|
m_wnd = MGL_wmCreateWindow(g_winMng,
|
||||||
parent ? parent->GetHandle() : NULL,
|
parent ? parent->GetHandle() : NULL,
|
||||||
@@ -586,6 +587,7 @@ void wxWindowMGL::SetFocus()
|
|||||||
|
|
||||||
if ( IsTopLevel() )
|
if ( IsTopLevel() )
|
||||||
{
|
{
|
||||||
|
// FIXME_MGL - this is wrong, see wxGTK!
|
||||||
wxActivateEvent event(wxEVT_ACTIVATE, TRUE, GetId());
|
wxActivateEvent event(wxEVT_ACTIVATE, TRUE, GetId());
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
GetEventHandler()->ProcessEvent(event);
|
||||||
@@ -614,6 +616,7 @@ void wxWindowMGL::KillFocus()
|
|||||||
|
|
||||||
if ( IsTopLevel() )
|
if ( IsTopLevel() )
|
||||||
{
|
{
|
||||||
|
// FIXME_MGL - this is wrong, see wxGTK!
|
||||||
wxActivateEvent event(wxEVT_ACTIVATE, FALSE, GetId());
|
wxActivateEvent event(wxEVT_ACTIVATE, FALSE, GetId());
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
GetEventHandler()->ProcessEvent(event);
|
||||||
|
Reference in New Issue
Block a user